handlebars-lang / handlebars-lang/handlebars.js
Option for custom escaping function in `Handlebars.compile`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.7k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Handlebars.compile and Handlebars.escapeExpression entry points, and inspect how the existing noEscape option changes escaping. Define the callback behavior and verify that compiled templates use the supplied function instead of the default escaping; the payload does not name a test file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- handlebars, javascript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100