Allow an empty variable tag during strict parsing for liquid-c compat (#1320)

This commit is contained in:
Dylan Thacker-Smith
2020-10-20 14:11:48 -04:00
committed by GitHub
parent 866e437c05
commit ae6bd9f6b0
2 changed files with 6 additions and 0 deletions

View File

@@ -63,6 +63,8 @@ module Liquid
@filters = []
p = Parser.new(markup)
return if p.look(:end_of_string)
@name = Expression.parse(p.expression)
while p.consume?(:pipe)
filtername = p.consume(:id)

View File

@@ -118,6 +118,10 @@ class ParsingQuirksTest < Minitest::Test
end
end
def test_blank_variable_markup
assert_template_result('', "{{}}")
end
def test_contains_in_id
assert_template_result(' YES ', '{% if containsallshipments == true %} YES {% endif %}', 'containsallshipments' => true)
end