Skip to content

Commit

Permalink
use byteslice to create Variable BlockBody
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmichaelgo committed Oct 25, 2024
1 parent cb16219 commit fb6ac72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/liquid/block_body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@ def create_variable(token, parse_context)
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

Expand Down

0 comments on commit fb6ac72

Please sign in to comment.