Use .last instead of pop push method for updating last node in nodelist

This commit is contained in:
Michael Angell
2016-07-08 20:49:30 +10:00
parent e1d40c7d89
commit 283f1bad18

View File

@@ -56,10 +56,9 @@ module Liquid
def whitespace_handler(token, parse_context)
if token[2] == WhitespaceControl
previous_token = @nodelist.pop
previous_token = @nodelist.last
if previous_token.is_a? String
previous_token.rstrip!
@nodelist << previous_token
end
end
parse_context.trim_whitespace = (token[-3] == WhitespaceControl)