Since 4.0.0 'nil' values are ignored inside cycle tag
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
The code below has different renders using liquid versions <=3.0.6 and 4.0.0
{% for i in (1..4) %}
{% cycle '<section>', nil %}
<div>
<p>{{ i }}</p>
</div>
{% cycle nil, '</section>' %}
{% endfor %}
3.0.6 Two 'section' blocks:
<section>
<div>
<p>1</p>
</div>
<div>
<p>2</p>
</div>
</section>
<section>
<div>
<p>3</p>
</div>
<div>
<p>4</p>
</div>
</section>
4.0.0 Four 'section' blocks:
<section>
<div>
<p>1</p>
</div>
</section>
<section>
<div>
<p>2</p>
</div>
</section>
<section>
<div>
<p>3</p>
</div>
</section>
<section>
<div>
<p>4</p>
</div>
</section>
The upgrade to 4.0.0 is breaking the appearance of a website I'm supporting. I've not found any documentation references for such 'cycle' usage, so I'm not sure if it is some hack worked in previous verions or it's a bug of 4.0.0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied cycle-tag example under Liquid 3.0.6 and 4.0.0, then trace the cycle tag entry point and its handling of nil values. Done means the intended grouping is established and covered by a regression test, with the example rendering consistently under the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100