summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/handlebars.l12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/handlebars.l b/src/handlebars.l
index 018096b..7593189 100644
--- a/src/handlebars.l
+++ b/src/handlebars.l
@@ -23,10 +23,16 @@ ID [^\s!"#%-,\.\/;->@\[-\^`\{-~]+/[=}\s\/.]
%%
-"\\\\"/("{{") yytext = "\\"; return 'CONTENT';
[^\x00]*?/("{{") {
- if(yytext.slice(-1) !== "\\") this.begin("mu");
- if(yytext.slice(-1) === "\\") strip(0,1), this.begin("emu");
+ if(yytext.slice(-2) === "\\\\") {
+ strip(0,1);
+ this.begin("mu");
+ } else if(yytext.slice(-1) === "\\") {
+ strip(0,1);
+ this.begin("emu");
+ } else {
+ this.begin("mu");
+ }
if(yytext) return 'CONTENT';
}