Write one value at a time for array variables (#1863)

* Write one value at a time for array variables

* Handle recursive array
This commit is contained in:
Ian Ker-Seymer
2024-12-11 10:16:58 -05:00
committed by GitHub
parent 9a06cedbba
commit 63583ffe5b
2 changed files with 16 additions and 6 deletions
+12 -6
View File
@@ -95,15 +95,21 @@ module Liquid
def render_to_output_buffer(context, output)
obj = render(context)
render_obj_to_output(obj, output)
output
end
if obj.is_a?(Array)
output << obj.join
elsif obj.nil?
else
def render_obj_to_output(obj, output)
case obj
when NilClass
# Do nothing
when Array
obj.each do |o|
render_obj_to_output(o, output)
end
when
output << obj.to_s
end
output
end
def disabled?(_context)