handlebars-lang / handlebars.js

Minimal templating on steroids.
http://handlebarsjs.com
MIT License
17.98k stars 2.04k forks source link

Option for custom escaping function in `Handlebars.compile` #1746

Open silverwind opened 3 years ago

silverwind commented 3 years ago

Handlebars.compile allows to disable HTML escaping via noEscape but I'm looking for more control over the escaping to support arbitrary output formats with their own escaping rules.

I'd propose a new escapeExpression option on Handlebars.compile which takes a function that will do the escaping in place of Handlebars.escapeExpression.

Eric24 commented 3 years ago

@silverwind - Did you do any more work on this? I'm interested in something similar.

jaylinski commented 1 year ago

Related to #1523.