use byteslice to create Variable BlockBody

This commit is contained in:
Michael Go
2024-10-25 15:41:35 -03:00
parent cb16219552
commit fb6ac72520
+2 -1
View File
@@ -251,8 +251,9 @@ module Liquid
i = 3 if token[i] == "-"
parse_end = token.length - 3
parse_end -= 1 if token[parse_end] == "-"
markup_end = parse_end - i + 1
markup = markup_end <= 0 ? "" : token.byteslice(i, markup_end)
markup = token[i..parse_end]
return Variable.new(markup, parse_context)
end