You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this test case, I’ve used whitespace control on just one side of just one {{else if}} branch:
constHandlebars=require("handlebars");constsource=`\{{#if a}}a{{else if b}}b{{else if c}}c{{~else if d}}d{{else if e}}e{{else if f}}f{{else if g}}g{{/if}}`;consttemplate=Handlebars.compile(source);console.log(JSON.stringify(template({a: 1})));console.log(JSON.stringify(template({b: 1})));console.log(JSON.stringify(template({c: 1})));console.log(JSON.stringify(template({d: 1})));console.log(JSON.stringify(template({e: 1})));console.log(JSON.stringify(template({f: 1})));console.log(JSON.stringify(template({g: 1})));
But two of the outputs are affected:
"a\n"
"b\n"
"c"
"d\n"
"e"
"f\n"
"g\n"
I expect the whitespace control to only affect "c", so "e" should be "e\n".
In this test case, I’ve used whitespace control on just one side of just one
{{else if}}
branch:But two of the outputs are affected:
I expect the whitespace control to only affect
"c"
, so"e"
should be"e\n"
.Using Handlebars 4.7.8 on Node.js 20.11.1.
Playground link.
The text was updated successfully, but these errors were encountered: