Shopify / liquid

Liquid markup language. Safe, customer facing template language for flexible web apps.
https://shopify.github.io/liquid/
MIT License
11.11k stars 1.39k forks source link

Warning when variable starts with a number #1574

Open emm26 opened 2 years ago

emm26 commented 2 years ago

Hello, I think you might be able to help me with this issue.

when parsing a template that contains a variable that begins with a number I get this warning here:

script = '{% if variable==true or 2variable==false%}{% remove %}{% endif %}'
Liquid::Template.parse(script, error_mode: :warn).warnings
Liquid::SyntaxError: Liquid syntax error: Expected end_of_string but found id in "variable==true or 2variable==false"

If I change the variable name to not begin with a number I don't get any warnings.

I don't understand why this scenario translates into a warning

fernandonavajas commented 8 months ago

I have the same problem :C, I don't see it being resolved.