Escape sequences that the string-literal parser does not recognize lose their backslash. Python/Jinja2 keep the backslash of an unrecognized escape.
Reproduction
Template bytes: {{'\\\}'}}
Jinja2 renders \\} (two backslashes followed by a brace). ginger renders \}.
Inside a larger string, {{'\\\{N__xvada_ignored_ws_v1}'}} renders \\{N__xvada_ignored_ws_v1} in Jinja2 and \{N__xvada_ignored_ws_v1} in ginger.
Root cause
src/Text/Ginger/Parse.hs:1285-1304: after the named escapes (\n, \r, \b, \v, \0, \t), the catch-all at line 1303 returns the escaped character without the backslash.
Escape sequences that the string-literal parser does not recognize lose their backslash. Python/Jinja2 keep the backslash of an unrecognized escape.
Reproduction
Template bytes:
{{'\\\}'}}Jinja2 renders
\\}(two backslashes followed by a brace). ginger renders\}.Inside a larger string,
{{'\\\{N__xvada_ignored_ws_v1}'}}renders\\{N__xvada_ignored_ws_v1}in Jinja2 and\{N__xvada_ignored_ws_v1}in ginger.Root cause
src/Text/Ginger/Parse.hs:1285-1304: after the named escapes (\n,\r,\b,\v,\0,\t), the catch-all at line 1303 returns the escaped character without the backslash.