mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Fix FrozenError for blank case tag with multiple expression when tag (#1340)
This commit is contained in:
committed by
GitHub
parent
3a591fbf26
commit
ea6e326b9c
@@ -22,8 +22,11 @@ module Liquid
|
||||
body = new_body
|
||||
body = @blocks.last.attachment while parse_body(body, tokens)
|
||||
@blocks.each do |condition|
|
||||
condition.attachment.remove_blank_strings if blank?
|
||||
condition.attachment.freeze
|
||||
body = condition.attachment
|
||||
unless body.frozen?
|
||||
body.remove_blank_strings if blank?
|
||||
body.freeze
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -213,6 +213,11 @@ class StandardTagTest < Minitest::Test
|
||||
assert_template_result('', code, 'condition' => 'something else')
|
||||
end
|
||||
|
||||
def test_case_when_comma_and_blank_body
|
||||
code = '{% case condition %}{% when 1, 2 %} {% assign r = "result" %} {% endcase %}{{ r }}'
|
||||
assert_template_result('result', code, 'condition' => 2)
|
||||
end
|
||||
|
||||
def test_assign
|
||||
assert_template_result('variable', '{% assign a = "variable"%}{{a}}')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user