diff options
author | Daniel Marcotte <dmarcotte@gmail.com> | 2013-11-06 08:20:49 -0800 |
---|---|---|
committer | Daniel Marcotte <dmarcotte@gmail.com> | 2013-11-06 08:20:49 -0800 |
commit | 9d353bd3dd24b1e975ddf14a77179d4ab016706c (patch) | |
tree | 3c9690c349280ffd456c2462013070c8756f4057 /src | |
parent | 47d13cb23c968ada3878b8bacf2813fb01758475 (diff) | |
download | handlebars.js-9d353bd3dd24b1e975ddf14a77179d4ab016706c.zip handlebars.js-9d353bd3dd24b1e975ddf14a77179d4ab016706c.tar.gz handlebars.js-9d353bd3dd24b1e975ddf14a77179d4ab016706c.tar.bz2 |
Fix "\\{{" immediately following "\{{"
Escaped-escape mustaches ("\\{{") immediately following escaped
mustaches ("\{{") were being handled incorrectly.
Fix the lookahead to make sure yytext still contains the appropriate
slashes when we pop out of <emu> so they can be handled consistently
by the initial state.
Diffstat (limited to 'src')
-rw-r--r-- | src/handlebars.l | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/handlebars.l b/src/handlebars.l index ddb7fe9..4205470 100644 --- a/src/handlebars.l +++ b/src/handlebars.l @@ -43,9 +43,9 @@ ID [^\s!"#%-,\.\/;->@\[-\^`\{-~]+/{LOOKAHEAD} [^\x00]+ return 'CONTENT'; -<emu>[^\x00]{2,}?/("{{"|<<EOF>>) { - if(yytext.slice(-1) !== "\\") this.popState(); - if(yytext.slice(-1) === "\\") strip(0,1); +// marks CONTENT up to the next mustache or escaped mustache +<emu>[^\x00]{2,}?/("{{"|"\\{{"|"\\\\{{"|<<EOF>>) { + this.popState(); return 'CONTENT'; } |