EscapingPolicy

15 views
Skip to first unread message

Johannes Ernst

unread,
Feb 1, 2018, 3:38:57 PM2/1/18
to handlebars.java
I'm also baffled by how to use EscapingPolicy. A number of them seem to have been predefined, but the only way I can see picking which one to use would be by creating a separate instance of Handlebars with

new Handlebars().with( policy )

So if I wanted to emit output that prints:

"... and here is how this object will be formatted with different escaping policies:
* no op: XX"YY
* foo: XX\"YY
* bar: XX""YY
"

Is there a way to "slide" the escaping policy into the Helper invocation somehow? Paraphrasing:

{{object policy="noop"}}
{{object policy="foo"}}
{{object policy="bar"}}

If so, I can't quite see how to do that.

Reply all
Reply to author
Forward
0 new messages