diff --git a/lib/liquid/tags/cycle.rb b/lib/liquid/tags/cycle.rb index aa7f64ce..1df692e6 100644 --- a/lib/liquid/tags/cycle.rb +++ b/lib/liquid/tags/cycle.rb @@ -13,7 +13,7 @@ module Liquid #
Item five
# class Cycle < Tag - SimpleSyntax = /^#{QuotedFragment}/ + SimpleSyntax = /^#{QuotedFragment}+/ NamedSyntax = /^(#{QuotedFragment})\s*\:\s*(.*)/ def initialize(tag_name, markup, tokens) diff --git a/test/regexp_test.rb b/test/regexp_test.rb index 719324cd..10717c1b 100644 --- a/test/regexp_test.rb +++ b/test/regexp_test.rb @@ -11,10 +11,15 @@ class RegexpTest < Test::Unit::TestCase assert_equal ['"arg 1"'], '"arg 1"'.scan(QuotedFragment) end - def test_words assert_equal ['arg1', 'arg2'], 'arg1 arg2'.scan(QuotedFragment) end + + def test_tags + assert_equal ['', ''], ' '.scan(QuotedFragment) + assert_equal [''], ''.scan(QuotedFragment) + assert_equal ['', ''], %||.scan(QuotedFragment) + end def test_quoted_words assert_equal ['arg1', 'arg2', '"arg 3"'], 'arg1 arg2 "arg 3"'.scan(QuotedFragment) diff --git a/test/standard_tag_test.rb b/test/standard_tag_test.rb index e2255793..37d5c137 100644 --- a/test/standard_tag_test.rb +++ b/test/standard_tag_test.rb @@ -351,6 +351,9 @@ HERE assert_template_result('text-align: left,text-align: right','{%cycle "text-align: left", "text-align: right" %},{%cycle "text-align: left", "text-align: right"%}') + assert_template_result('','.{% cycle '' %}') + assert_template_result('','.{% cycle "" %}') + assert_template_result('','.{% cycle "", "" %}') assert_template_result('.','.{% cycle "", "", "" %}') assert_template_result('... ','.{% cycle "", "", "" %}.{% cycle "", "", "" %}.{% cycle "", "", "" %} {% cycle "", "", "" %}')