| @@ -398,7 +398,7 @@ | |||||
| nonSpace = false; | nonSpace = false; | ||||
| } | } | ||||
| var start, type, value, chr; | |||||
| var start, type, value, chr, token; | |||||
| while (!scanner.eos()) { | while (!scanner.eos()) { | ||||
| start = scanner.pos; | start = scanner.pos; | ||||
| value = scanner.scanUntil(tagRes[0]); | value = scanner.scanUntil(tagRes[0]); | ||||
| @@ -413,24 +413,21 @@ | |||||
| nonSpace = true; | nonSpace = true; | ||||
| } | } | ||||
| tokens.push(["text", chr, start, start + 1]); | |||||
| tokens.push(['text', chr, start, start + 1]); | |||||
| start += 1; | start += 1; | ||||
| if (chr === "\n") { | |||||
| stripSpace(); // Check for whitespace on the current line. | |||||
| } | |||||
| // Check for whitespace on the current line. | |||||
| if (chr == '\n') stripSpace(); | |||||
| } | } | ||||
| } | } | ||||
| start = scanner.pos; | start = scanner.pos; | ||||
| // Match the opening tag. | // Match the opening tag. | ||||
| if (!scanner.scan(tagRes[0])) { | |||||
| break; | |||||
| } | |||||
| if (!scanner.scan(tagRes[0])) break; | |||||
| hasTag = true; | hasTag = true; | ||||
| type = scanner.scan(tagRe) || "name"; | |||||
| type = scanner.scan(tagRe) || 'name'; | |||||
| // Skip any whitespace between tag and value. | // Skip any whitespace between tag and value. | ||||
| scanner.scan(whiteRe); | scanner.scan(whiteRe); | ||||
| @@ -468,7 +465,7 @@ | |||||
| } | } | ||||
| } | } | ||||
| var token = [type, value, start, scanner.pos]; | |||||
| token = [type, value, start, scanner.pos]; | |||||
| tokens.push(token); | tokens.push(token); | ||||
| if (type === '#' || type === '^') { | if (type === '#' || type === '^') { | ||||