mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-02 16:45:12 -07:00
Consistency in warnings.
This commit is contained in:
+1
-3
@@ -67,10 +67,8 @@ module Liquid
|
|||||||
all_warnings = []
|
all_warnings = []
|
||||||
all_warnings.concat(@warnings) if @warnings
|
all_warnings.concat(@warnings) if @warnings
|
||||||
|
|
||||||
return all_warnings unless @children
|
|
||||||
@children.each do |node|
|
@children.each do |node|
|
||||||
node_warns = node.respond_to?(:warnings) ? node.warnings : nil
|
all_warnings.concat(node.warnings || [])
|
||||||
all_warnings.concat(node_warns) if node_warns
|
|
||||||
end
|
end
|
||||||
|
|
||||||
all_warnings
|
all_warnings
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ module Liquid
|
|||||||
def initialize(markup, options = {})
|
def initialize(markup, options = {})
|
||||||
@markup = markup
|
@markup = markup
|
||||||
@name = nil
|
@name = nil
|
||||||
@warnings = []
|
|
||||||
@options = options || {}
|
@options = options || {}
|
||||||
|
|
||||||
|
|
||||||
@@ -29,6 +28,7 @@ module Liquid
|
|||||||
begin
|
begin
|
||||||
strict_parse(markup)
|
strict_parse(markup)
|
||||||
rescue SyntaxError => e
|
rescue SyntaxError => e
|
||||||
|
@warnings ||= []
|
||||||
@warnings << e
|
@warnings << e
|
||||||
lax_parse(markup)
|
lax_parse(markup)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user