Add concept of Liquid::Environment (#1815)

* Add concept of `Liquid::World`

* Rename `World` to `Environment`
This commit is contained in:
Ian Ker-Seymer
2024-08-07 15:00:44 -04:00
committed by GitHub
parent a0411e0927
commit fb6634f454
38 changed files with 463 additions and 226 deletions
+2 -6
View File
@@ -52,7 +52,7 @@ module Liquid
next parse_liquid_tag(markup, parse_context)
end
unless (tag = registered_tags[tag_name])
unless (tag = parse_context.environment.tag_for_name(tag_name))
# end parsing if we reach an unknown tag and let the caller decide
# determine how to proceed
return yield tag_name, markup
@@ -147,7 +147,7 @@ module Liquid
next
end
unless (tag = registered_tags[tag_name])
unless (tag = parse_context.environment.tag_for_name(tag_name))
# end parsing if we reach an unknown tag and let the caller decide
# determine how to proceed
return yield tag_name, markup
@@ -262,9 +262,5 @@ module Liquid
def raise_missing_variable_terminator(token, parse_context)
BlockBody.raise_missing_variable_terminator(token, parse_context)
end
def registered_tags
Template.tags
end
end
end