Parse Handlebars and HTML.
Parse this:
into this:
[ { type:"htmlTagStart", closing:false }, { type:"htmlTagNameStart" }, { type:"hbsVariable", id:"tag" }, { type:"htmlTagNameEnd" }, { type:"text", text:"value" }, { type:"htmlTagStart", closing:true }, { type:"htmlTagNameStart" }, { type:"hbsVariable", id:"tag" }, { type:"htmlTagNameEnd" }, { type:"htmlTagEnd" } ]…for use in compiling to something like a virtual DOM, such that of handlebars-react.
For more information on the strengths, weaknesses and implementation details of this library, check out the wiki.
-
How is this different from HTMLBars?
HTMLBars builds a DOM whereas this library allows you to build a DOM and even a virtual DOM. -
Why not use parse5?
As of v1.2.0, it is not forgiving enough, in that it will parse<{{tag}}>asdf</{{tag}}>as text instead of HTML.
- add support for sub-expressions, whitespace control, etc
options.collapseWhitespace(except on<pre>tags) to lighten file size and improve runtime performanceoptions.ignoreCommentsto omit html comments from compilingoptions.mustacheOnlythat disables helpers
- 0.0.1–0.0.3 pre-releases