Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

The chars a TextNode inside a BlockStatement is a lie. #454

Open
ghost opened this issue Apr 17, 2016 · 2 comments
Open

The chars a TextNode inside a BlockStatement is a lie. #454

ghost opened this issue Apr 17, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 17, 2016

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.

@rwjblue
Copy link
Collaborator

rwjblue commented Apr 17, 2016

It is actually "correct". A block statement or mustache statement will "eat" a newline if it follows directly after the mustaches.

@mmun
Copy link
Collaborator

mmun commented Apr 19, 2016

This is a default feature of the Handlebars parser. We can disable it but it is a breaking change. See
handlebars-lang/handlebars.js#1072 and handlebars-lang/handlebars.js@ea3a5a1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants