handlebars.java icon indicating copy to clipboard operation
handlebars.java copied to clipboard

Raw block does not allow single '{{'

Open miguelpais opened this issue 3 years ago • 0 comments

I've enabled raw block support according to the documentation, through:

handlebars.registerHelper("raw", (context, options) -> options.fn());

The problem is that, when passed a template as such:

{
"text": "{{{{raw}}}}as{{d{{{{/raw}}}}"
}

This version of handlebars cannot parse it, since it expects the {{ open inside the raw block to get closed. In my use case, it's more likely users would like to escape {{ than a string of type {{ < sometag > }}. How could this be handled? Am I doing something wrong?

miguelpais avatar Feb 03 '23 09:02 miguelpais