diff --git a/lib/liquid/block_body.rb b/lib/liquid/block_body.rb index ec40e2129..964758b65 100644 --- a/lib/liquid/block_body.rb +++ b/lib/liquid/block_body.rb @@ -246,10 +246,16 @@ def render_node(context, output, node) end def create_variable(token, parse_context) - if token =~ ContentOfVariable - markup = Regexp.last_match(1) + if token.end_with?("}}") + i = 2 + i = 3 if token[i] == "-" + parse_end = token.length - 3 + parse_end -= 1 if token[parse_end] == "-" + + markup = token[i..parse_end] return Variable.new(markup, parse_context) end + BlockBody.raise_missing_variable_terminator(token, parse_context) end