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
We've encountered an issue with the unless tag where variables within the unless tag are not rendered. We have tried both an captured and assigned tag variables and one provided directly in the context.
Please see the test case below:
var { Liquid } = require('liquidjs');
var engine = new Liquid();
engine.parseAndRender(`
{%- capture quantity -%}
<input type="number" step="1" />
{%- endcapture -%}
{%- assign test_var = 'logo.png' -%}
<div>
<p>This is outside of unless:</p>
Location: {{ location }}
Quantity: {{ quantity }}
Test Var: {{ test_var }}
</div>
{% unless location == 'alice' %}
<div class="not-alice">
<p>This is inside the unless</p>
<ul>
<li>Location: {{ location }}</li>
<li>Quantity: {{ quantity }}</li>
<li>Test Var: {{ test_var }}</li>
</ul>
</div>
{% endunless %}
<div>
<p>This is after the unless</p>
Location: {{ location }}
Quantity: {{ quantity }}
Test Var: {{ test_var }}
</div>
`, {location: 'wonderland'}).then(console.log);
Output with location=wonderland:
<div>
<p>This is outside of unless:</p>
Location: wonderland
Quantity: <input type="number" step="1" />
Test Var: logo.png
</div>
<div class="not-alice">
<p>This is inside the unless</p>
<ul>
<li>Location:
<div>
<p>This is after the unless</p>
Location: wonderland</li>
<li>Quantity: wonderland
Quantity: <input type="number" step="1" /></li>
<li>Test Var: <input type="number" step="1" />
Test Var: logo.png</li>
</ul>
</div>
logo.png
</div>
Output with location=alice:
<div>
<p>This is outside of unless:</p>
Location: alice
Quantity: <input type="number" step="1" />
Test Var: logo.png
</div>
<div>
<p>This is after the unless</p>
Location: alice
Quantity: <input type="number" step="1" />
Test Var: logo.png
</div>
We expect that:
The unless condition would behave like the outside conditions, which you can experience by changing the context variable location to alice
All three test variables that render inside the unless tag would be consistent with the ones outside.
The variables would be in the proper order, which you will see that they are not in the test case output.
The text was updated successfully, but these errors were encountered:
@harttle - hello!
We've encountered an issue with the
unless
tag where variables within the unless tag are not rendered. We have tried both an captured and assigned tag variables and one provided directly in the context.Please see the test case below:
Output with location=wonderland:
Output with location=alice:
We expect that:
location
toalice
unless
tag would be consistent with the ones outside.The text was updated successfully, but these errors were encountered: