mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Merge branch 'master' of git://github.com/EmmanuelOga/liquid into EmmanuelOga/master
This commit is contained in:
+3
-1
@@ -35,7 +35,9 @@ module Liquid
|
|||||||
VariableIncompleteEnd = /\}\}?/
|
VariableIncompleteEnd = /\}\}?/
|
||||||
QuotedFragment = /"[^"]+"|'[^']+'|[^\s,|]+/
|
QuotedFragment = /"[^"]+"|'[^']+'|[^\s,|]+/
|
||||||
TagAttributes = /(\w+)\s*\:\s*(#{QuotedFragment})/
|
TagAttributes = /(\w+)\s*\:\s*(#{QuotedFragment})/
|
||||||
TemplateParser = /(#{TagStart}.*?#{TagEnd}|#{VariableStart}.*?#{VariableIncompleteEnd})/
|
AnyStartingTag = /\{\{|\{\%/
|
||||||
|
PartialTemplateParser = /#{TagStart}.*?#{TagEnd}|#{VariableStart}.*?#{VariableIncompleteEnd}/
|
||||||
|
TemplateParser = /(#{PartialTemplateParser}|#{AnyStartingTag})/
|
||||||
VariableParser = /\[[^\]]+\]|#{VariableSegment}+/
|
VariableParser = /\[[^\]]+\]|#{VariableSegment}+/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,17 @@ class ParsingQuirksTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_raise_on_label_and_no_close_bracets
|
||||||
|
assert_raise(SyntaxError) do
|
||||||
|
Template.parse("TEST {{ ")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_raise_on_label_and_no_close_bracets_percent
|
||||||
|
assert_raise(SyntaxError) do
|
||||||
|
Template.parse("TEST {% ")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_error_on_empty_filter
|
def test_error_on_empty_filter
|
||||||
assert_nothing_raised do
|
assert_nothing_raised do
|
||||||
@@ -26,4 +37,5 @@ class ParsingQuirksTest < Test::Unit::TestCase
|
|||||||
Template.parse("{{|test|}}")
|
Template.parse("{{|test|}}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user