Closed LeJared closed 6 years ago
...what a strange bug!
Here is a slightly simplified version covering one more case: https://jsfiddle.net/zaafvw7o/8/
<p>a{{#if 1}} b{{/if}}</p>
<p>{{#if 1}}d {{/if}}e</p>
<p>a{{#if 1}} b{{/if}} / {{#if 1}}d {{/if}}e</p>
<p>a{{#if 1}} b{{/if}} / {{#if 1}}d {{/if}}e / a{{#if 1}} b{{/if}}</p>
This is weird. I haven't really messed with the whitespace munging code in the parser before, so until I can poke at it some, preserveWhitespace: true
should be a workaround. I'm guessing that whitespace stripping is pulling any whitespace inside of a block (element, section) when it should only be merging the space or removing from the first newline. Whitespace handling in HTML is already pretty weird too...
I'm pretty sure I've got this fixed, though the whitespace handling still isn't 100% ideal. For some reason, npm cli isn't showing the latest published versions, so Travis isn't able to publish. Once that's resolved, this should be fixed in edge and v0.10-dev. Thanks!
Description:
See example below in jsfiddle. The leading whitespace in the first condition in the first paragraph is removed. It does not happen in the second paragraph. This seems to be trigger by the presence of the second condition in the first paragraph.
Versions affected:
at least 0.9.13 to 0.10.3
Reproduction:
https://jsfiddle.net/lejared/zaafvw7o/4/