tablerow: Avoid accidental special case for constant nil cols (#1644)

It should behave the same as an expression that evaluates to nil
This commit is contained in:
Dylan Thacker-Smith
2022-10-25 10:21:03 -04:00
committed by GitHub
parent c99c93255d
commit 6ce4ec1011
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ module Liquid
collection = Utils.slice_collection(collection, from, to)
length = collection.length
cols = @attributes['cols'].nil? ? length : context.evaluate(@attributes['cols']).to_i
cols = @attributes.key?('cols') ? context.evaluate(@attributes['cols']).to_i : length
output << "<tr class=\"row1\">\n"
context.stack do