Introduce template factory

This commit is contained in:
Martin Morissette
2019-12-17 21:45:08 -05:00
parent 6c6382ed69
commit d8f31046a9
6 changed files with 74 additions and 1 deletions
+4 -1
View File
@@ -12,7 +12,10 @@ module Liquid
parse_context.partial = true
partial = Liquid::Template.parse(source, parse_context)
template_factory = (context.registers[:template_factory] ||= Liquid::TemplateFactory.new)
template = template_factory.for(template_name)
partial = template.parse(source, parse_context)
cached_partials[template_name] = partial
ensure
parse_context.partial = false