Open wermos opened 5 months ago
We are not doing anything special with either value: just getting the string value and using those: https://github.com/getzola/zola/blob/master/components/templates/src/filters.rs#L96-L129 no escape in sight, unless it's the regex crate that handles the escaping.
The docs don't mention anything about this, but it looks to me like the
pattern=
needs backslashes to be escaped, but therep=
part doesn't need any special escaping.I feel that this is inconsistent behavior, but it's not a big deal. I do think, however, it would be great to mention this in the docs.
For context, I was replacing
\\
with\\\\
because of the markdown parser gobbling up the first backslash as an escaping character. I also did the same with for\,
=>\\,
and\!
=>\\!
. These are commonly used in LaTeX, and due to the unexpected backslash consumption, the MathJax wasn't coming out the way you'd expect.