Handlebars icon indicating copy to clipboard operation
Handlebars copied to clipboard

Escaping of mustaches ignored

Open nknapp opened this issue 6 years ago • 0 comments

In Handlebars, a backslash can be used to prevent a mustache from being evaluated. Such a mustache is essentially text.

\{{no-expression}} {{expression}}

\{{{no-expression}}} {{expression}}

\{{#no}} block \{{/no}} {{expression}}

\{{\{{no}}}} block \{{\{{/no}}}} {{expression}}

see jsfiddle demonstrating the usage

I noticed that at least in GitHub markdown, the escaped mustaches are displayed just like regular expressions.

I came across this behavior when I made a similar pull request for highlight.js, it has not urgency for me. I just wanted to report it.

nknapp avatar Oct 13 '19 20:10 nknapp