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