TL;DR the regex used to support expression ignoring seems to not work on text nodes correctly. Also, the one for ignored unescaped delimiters (i.e. @{{{ foo }}}) doesn't seem to work at all.
When you have a text node with mixed expressions {{ foo }} and ignored expressions @{{ foo }}, they are rendered incorrectly.
Given we set foo: 'bar' in locals, this is what is currently happening:
This only appears to happen within text nodes, if each line is wrapped in an HTML tag then ignored and rendered are correct. ignoredUnescaped will still be wrong:
See https://github.com/posthtml/posthtml-expressions/tree/textnode-ignore for a reproduction, just run the core tests:
TL;DR the regex used to support expression ignoring seems to not work on text nodes correctly. Also, the one for ignored unescaped delimiters (i.e.
@{{{ foo }}}
) doesn't seem to work at all.When you have a text node with mixed expressions
{{ foo }}
and ignored expressions@{{ foo }}
, they are rendered incorrectly.Given we set
foo: 'bar'
inlocals
, this is what is currently happening:Source:
Expected:
Actual:
Note
This only appears to happen within text nodes, if each line is wrapped in an HTML tag then
ignored
andrendered
are correct.ignoredUnescaped
will still be wrong:Source:
Expected:
Actual: