mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 11:20:41 -07:00
Include for tag arguments in formatted output
This commit is contained in:
@@ -130,7 +130,12 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def format
|
def format
|
||||||
out = "{% for #{@variable_name} in #{Expression.format(@collection_name)} %}"
|
args = [Expression.format(@collection_name)]
|
||||||
|
args << "reversed" if @reversed
|
||||||
|
args << "limit: #{Expression.format(@limit)}" if @limit
|
||||||
|
args << "offset: " << (@from == :continue ? 'continue' : Expression.format(@from)) if @from
|
||||||
|
|
||||||
|
out = "{% for #{@variable_name} in #{args.join(' ')} %}"
|
||||||
out << @for_block.format
|
out << @for_block.format
|
||||||
if @else_block
|
if @else_block
|
||||||
out << "{% else %}"
|
out << "{% else %}"
|
||||||
|
|||||||
Reference in New Issue
Block a user