Closed bcronin closed 10 years ago
don't add the closing bracket, or use the "&" synonym for triple-stache.
var context = {myvariable: "|<>|_"} var rawText = "<%{ myvariable %>" var template = Hogan.compile(rawText, { delimiters : "<% %>" }); template.render(context) '|<>|_' var rawText = "<%& myvariable %>" template = Hogan.compile(rawText, { delimiters : "<% %>" }); template.render(context) '|<>|_'
If a template is compiled with custom delimiters then unescaped HTML does not expand correctly.
E.g. the template is compiled with
Hogan.compile(rawText, { delimiters : "<% %>" });
, then<%{ my_variable }%>
does not expand correctly.The best workaround I've found is a verbose temporary re-override of the delimiters: