raw tag delimiter like this is raising a syntax error:
{% raw %}123{%endraw%}
How are you solving this issue?
This PR refactored the raw.c's match_full_token_possibly_invalid method.
It will search the token from its end to its start, and try to match the tag delimiter that is only made up with a word character, \w.
This refactor also fixes how Liquid-C allows - character before the raw tag's delimiter.
In example, these Liquid templates are invalid, and Liquid-C does not raise a syntax error:
require 'liquid'
require 'liquid/c'
Liquid::Template.parse("{% raw %}123{% - endraw %}") # this should raise an error
What you trying to solve?
This PR https://github.com/Shopify/liquid-c/pull/199 has broke how Liquid-C parses the
raw
tag's delimiter without any spaces.raw
tag delimiter like this is raising a syntax error:How are you solving this issue?
This PR refactored the
raw.c
'smatch_full_token_possibly_invalid
method. It will search the token from its end to its start, and try to match the tag delimiter that is only made up with a word character,\w
.This refactor also fixes how Liquid-C allows
-
character before theraw
tag's delimiter. In example, these Liquid templates are invalid, and Liquid-C does not raise a syntax error: