diff --git a/lib/liquid/tokenizer.rb b/lib/liquid/tokenizer.rb index 0724c28d..bc33adcb 100644 --- a/lib/liquid/tokenizer.rb +++ b/lib/liquid/tokenizer.rb @@ -7,7 +7,7 @@ module Liquid attr_reader :line_number, :for_liquid_tag TAG_END = /%\}/ - TAG_OR_VARIABLE_START = /\{[\{\%}]/ + TAG_OR_VARIABLE_START = /\{[\{\%]/ NEWLINE = /\n/ OPEN_CURLEY = "{".ord diff --git a/test/unit/tokenizer_unit_test.rb b/test/unit/tokenizer_unit_test.rb index 6e855724..a50b76ce 100644 --- a/test/unit/tokenizer_unit_test.rb +++ b/test/unit/tokenizer_unit_test.rb @@ -6,6 +6,7 @@ class TokenizerTest < Minitest::Test def test_tokenize_strings assert_equal([' '], tokenize(' ')) assert_equal(['hello world'], tokenize('hello world')) + assert_equal(['{}'], tokenize('{}')) end def test_tokenize_variables