diff --git a/lib/liquid.rb b/lib/liquid.rb index a58575a..1e970d2 100644 --- a/lib/liquid.rb +++ b/lib/liquid.rb @@ -33,7 +33,8 @@ module Liquid VariableStart = /\{\{/ VariableEnd = /\}\}/ VariableIncompleteEnd = /\}\}?/ - QuotedFragment = /"[^"]+"|'[^']+'|[^\s,|]+/ + QuotedString = /"[^"]+"|'[^']+'/ + QuotedFragment = /#{QuotedString}|(?:[^\s,\|'"]|#{QuotedString})+/ TagAttributes = /(\w+)\s*\:\s*(#{QuotedFragment})/ AnyStartingTag = /\{\{|\{\%/ PartialTemplateParser = /#{TagStart}.*?#{TagEnd}|#{VariableStart}.*?#{VariableIncompleteEnd}/ diff --git a/test/assign_test.rb b/test/assign_test.rb index 9bf6f2f..95e9755 100644 --- a/test/assign_test.rb +++ b/test/assign_test.rb @@ -4,7 +4,8 @@ class AssignTest < Test::Unit::TestCase include Liquid def test_assigned_variable - assert_template_result('.foo.','{% assign foo = values %}.{{ foo }}.', 'values' => %w{foo bar baz}) + assert_template_result('.foo.','{% assign foo = values %}.{{ foo[0] }}.', 'values' => %w{foo bar baz}) + assert_template_result('.bar.','{% assign foo = values %}.{{ foo[1] }}.', 'values' => %w{foo bar baz}) end end \ No newline at end of file