diff --git a/lib/liquid/document.rb b/lib/liquid/document.rb index 7ecced6e..c964ae84 100644 --- a/lib/liquid/document.rb +++ b/lib/liquid/document.rb @@ -1,8 +1,12 @@ module Liquid class Document < BlockBody + DEFAULT_OPTIONS = { + locale: I18n.new + } + def self.parse(tokens, options) doc = new - doc.parse(tokens, options) + doc.parse(tokens, DEFAULT_OPTIONS.merge(options)) doc end diff --git a/lib/liquid/template.rb b/lib/liquid/template.rb index 05b4114d..7b2897d9 100644 --- a/lib/liquid/template.rb +++ b/lib/liquid/template.rb @@ -13,10 +13,6 @@ module Liquid # template.render('user_name' => 'bob') # class Template - DEFAULT_OPTIONS = { - locale: I18n.new - } - attr_accessor :root attr_reader :resource_limits @@ -120,7 +116,7 @@ module Liquid @options = options @profiling = options[:profile] @line_numbers = options[:line_numbers] || @profiling - @root = Document.parse(tokenize(source), DEFAULT_OPTIONS.merge(options)) + @root = Document.parse(tokenize(source), options) @warnings = nil self end