Closed lazd closed 9 years ago
Because we're actually parsing the template HTML with cheerio/htmlparser2, entities are turned into their text equivalent... DOMly dumps strings into text nodes, and since entities are HTML, not text, they'll never be rendered if you do something like document.createTextNode('}')
. I don't think there's a way around this, and I'm pretty sure we won't have any HTML document encoding issues as a result.
I think this should end up in the documentation somewhere in case others notice this behavior or find problems that result from it.
In this example, compiled template is definitely behaving as though the entities are their respective text equivalents:
Thanks for the report @cif, I'm going to go ahead and close this as DOMly never deals with innerHTML
, just textContent
.
HTML entities will end up as their text equivalent.
The following template:
Ends up doing this:
However, this doesn't seem to be causing problems, and passing the actual entity to
createTextNode
will not result in the expected behavior.Thanks to @cif for reporting this behavior.