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.