-
-
Notifications
You must be signed in to change notification settings - Fork 384
Open
Description
The ESC_VAR
lexer function which supports escaped handlebars expressions using a backslash, only works for normal expressions that are defined using 2 curly brackets like \{{var}}
, but it does not work for raw expressions \{{{rawVar}}}
, or any custom delimiters \[[var]]
, giving a false syntax error:
com.github.jknack.handlebars.HandlebarsException: inline@f73de56:1:1: found: '\'
\{{{foo}}}
^
If you add these test cases to the Issue #294 test suite (original support for escaped vars), then you should see this error. This is a bug since it should be supported according the Handlebars spec.
@Test
public void escapeRawVars() throws IOException {
shouldCompileTo("\\{{{foo}}}", $, "{{{foo}}}");
}
@Test
public void escapeRawVarsWithText() throws IOException {
shouldCompileTo("before \\{{{foo}}} after", $, "before {{{foo}}} after");
}
I've added support in this PR #1085
Metadata
Metadata
Assignees
Labels
No labels