Fix the lexer to handle Strings with escaped quotes
This commit is contained in:
@@ -27,9 +27,9 @@ Handlebars.HandlebarsLexer.prototype.lex = function() {
|
||||
if(this.peek() == "}") this.getchar();
|
||||
return "CLOSE";
|
||||
} else if(this.peek() === '"') {
|
||||
this.getchar();
|
||||
while(this.peek() !== '"') { this.getchar() }
|
||||
this.getchar();
|
||||
this.readchar();
|
||||
while(this.peek() !== '"') { if(this.peek(2) === '\\"') { this.readchar() }; this.getchar() }
|
||||
this.readchar();
|
||||
return "STRING";
|
||||
} else {
|
||||
while(this.peek().match(/[A-Za-z]/)) { this.getchar() }
|
||||
|
||||
Reference in New Issue
Block a user