tldr:
In the liquid this template:
"{% cycle 1,2,3 %}{% assign list = \"1\" | split: \",\" %}{% for n in list %}{% cycle 1,2,3 %}{% endfor %}{% cycle 1,2,3 %}"
will give this output:
"123"
while this library gives "121" (incorrect)
Details:
In the liquid the track of the current cycle state is tracked in context.registers[:cycle] object, which itself is a hash-object, where the key is string representation of given cycle arguments, like "[1,2,3]", and the value is last iteration position, and this collection is global.
Same as https://github.com/bkiers/Liqp/issues/181 this is a part of the fix for https://github.com/bkiers/Liqp/issues/179
tldr: In the liquid this template:
"{% cycle 1,2,3 %}{% assign list = \"1\" | split: \",\" %}{% for n in list %}{% cycle 1,2,3 %}{% endfor %}{% cycle 1,2,3 %}"
will give this output:"123"
while this library gives"121"
(incorrect)Details: In the liquid the track of the current cycle state is tracked in
context.registers[:cycle]
object, which itself is a hash-object, where the key is string representation of given cycle arguments, like"[1,2,3]"
, and the value is last iteration position, and this collection is global. Same as https://github.com/bkiers/Liqp/issues/181 this is a part of the fix for https://github.com/bkiers/Liqp/issues/179