htmlbars
htmlbars copied to clipboard
The `chars` a TextNode inside a BlockStatement is a lie.
Example:
{{#foo}}
{{/foo}}
Will report a TextNode
inside the BlockStatement
with chars: '\n'
while this should be chars: '\n\n'
.
I would also accept the start location of the TextNode
to be on the new line.
It is actually "correct". A block statement or mustache statement will "eat" a newline if it follows directly after the mustaches.
This is a default feature of the Handlebars parser. We can disable it but it is a breaking change. See https://github.com/wycats/handlebars.js/issues/1072 and https://github.com/wycats/handlebars.js/commit/ea3a5a1.