mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Use .last instead of pop push method for updating last node in nodelist
This commit is contained in:
@@ -56,10 +56,9 @@ module Liquid
|
|||||||
|
|
||||||
def whitespace_handler(token, parse_context)
|
def whitespace_handler(token, parse_context)
|
||||||
if token[2] == WhitespaceControl
|
if token[2] == WhitespaceControl
|
||||||
previous_token = @nodelist.pop
|
previous_token = @nodelist.last
|
||||||
if previous_token.is_a? String
|
if previous_token.is_a? String
|
||||||
previous_token.rstrip!
|
previous_token.rstrip!
|
||||||
@nodelist << previous_token
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
parse_context.trim_whitespace = (token[-3] == WhitespaceControl)
|
parse_context.trim_whitespace = (token[-3] == WhitespaceControl)
|
||||||
|
|||||||
Reference in New Issue
Block a user