Example of trying to filter some text that has double escaped quotes inside of it:
{{ "let's try some \"quoted\" text" | my_filter }}
Example of trying to filter some text using an argument that has double escaped quotes inside of it:
{{ "text" | my_filter: "let's try some \"quoted\" argument" }}
These are scenarios that I have come across and it appears that the text and argument are both cut off at the first backslash \ because both 'QUOTED_STRING' => '"[^"]*"|\'[^\']*\'' and
'QUOTED_STRING_FILTER_ARGUMENT' => '"[^":]*"|\'[^\':]*\'', are greedy and stop after the first double quote " they find.
It seems that something like this might be a solution:
In \Liquid\Liquid change QUOTED_STRING and QUOTED_STRING_FILTER_ARGUMENT as follows:
Example of trying to filter some text that has double escaped quotes inside of it:
{{ "let's try some \"quoted\" text" | my_filter }}
Example of trying to filter some text using an argument that has double escaped quotes inside of it:
{{ "text" | my_filter: "let's try some \"quoted\" argument" }}
These are scenarios that I have come across and it appears that the text and argument are both cut off at the first backslash
\
because both'QUOTED_STRING' => '"[^"]*"|\'[^\']*\''
and'QUOTED_STRING_FILTER_ARGUMENT' => '"[^":]*"|\'[^\':]*\'',
are greedy and stop after the first double quote " they find.It seems that something like this might be a solution:
In
\Liquid\Liquid
changeQUOTED_STRING
andQUOTED_STRING_FILTER_ARGUMENT
as follows:Thanks @bigwhoop for help on this.