diff --git a/lib/liquid/block_body.rb b/lib/liquid/block_body.rb index 964758b65..98d28c9c1 100644 --- a/lib/liquid/block_body.rb +++ b/lib/liquid/block_body.rb @@ -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