Skip to content

Conversation

@aswamy
Copy link
Contributor

@aswamy aswamy commented Sep 3, 2025

What are you adding in this PR?

  • Detect invalid use of ranges in loops (for and tablerow tags)
  • Strict parser currently allows spaces within ranges (e.g. valid: ( 1..5), (1 .. 5)). The lax parser doesn't complain but does fail to render this. This is usually the reverse of what happens between strict/lax parsing. For consistency, we will just force all ranges to exist in the format (<start>..<end>)
    • This is why some times the markup is a string (when the entire range is invalid) and some times it is recognized as a valid ForMarkup from our ohm parser, but fails to render it when using our Liquid gem.

Tophat

  • Ensure all ranges conform to the following standard: (<start>..<end>)
  • Here are examples of bad ranges in loops
{% for num in (1...5) %}
  {{ num }}
{% endfor %}

{% for num in (1 .. 5) %}
  {{ num }}
{% endfor %}

{% for num in ( 1..5) %}
  {{ num }}
{% endfor %}

{% tablerow x in (a ..b) %}
  {{ x }}
{% endtablerow %}

Before you deploy

  • I included a patch bump changeset

@aswamy aswamy requested a review from a team as a code owner September 3, 2025 20:19
Copy link
Contributor

@graygilmore graygilmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎩 👍🏻

@aswamy aswamy merged commit 5ff6277 into main Sep 3, 2025
7 checks passed
@aswamy aswamy deleted the invalid-range-in-loops branch September 3, 2025 20:54
@aswamy aswamy added the #gsd:47376 Move to strict Liquid parser label Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:47376 Move to strict Liquid parser

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants