Port liquid-c bug compatible whitespace trimming

This commit is contained in:
Dylan Thacker-Smith
2020-09-08 21:03:27 -04:00
parent a372baa9cf
commit 9b6344f407
2 changed files with 21 additions and 0 deletions
+4
View File
@@ -142,7 +142,11 @@ module Liquid
if token[2] == WhitespaceControl
previous_token = @nodelist.last
if previous_token.is_a?(String)
first_byte = previous_token.getbyte(0)
previous_token.rstrip!
if previous_token.empty? && parse_context[:bug_compatible_whitespace_trimming] && first_byte
previous_token << first_byte
end
end
end
parse_context.trim_whitespace = (token[-3] == WhitespaceControl)