mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Fix strict parsing of find variable with a name expression
This commit is contained in:
@@ -52,6 +52,11 @@ module Liquid
|
||||
when :id
|
||||
str = consume
|
||||
str << variable_lookups
|
||||
when :open_square
|
||||
str = consume
|
||||
str << expression
|
||||
str << consume(:close_square)
|
||||
str << variable_lookups
|
||||
when :string, :number
|
||||
consume
|
||||
when :open_round
|
||||
|
||||
@@ -95,4 +95,8 @@ class VariableTest < Minitest::Test
|
||||
def test_render_symbol
|
||||
assert_template_result('bar', '{{ foo }}', 'foo' => :bar)
|
||||
end
|
||||
|
||||
def test_dynamic_find_var
|
||||
assert_template_result('bar', '{{ [key] }}', 'key' => 'foo', 'foo' => 'bar')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user