You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: The CommonMark parser does not do interpolation into code, latex, or HTML environments. MarkdownLiteral.jl, by using @htl first, supports interpolation into those environments. But by working on Julia strings, and not giving the option to work on raw strings, it handles backslashes in unexpected ways.
In Latex, backslashes must be doubled. cm"``\LaTeX``" must become @mdx "``\\LaTeX``"
In text, backslashes must be redoubled. cm"\@at" must become @mdx "\\\\\\@at".
Elaborating: Since Julia string processing uses backslash to escape characters, it does not play well with \LaTeX -- any backslashes have to be doubled. CommonMark avoids this by providing cm" " to operate on raw strings, so cm"Text ``\LaTeX``" can process MathJax inside the double back-ticks before the Julia string processing to the rest of the string. I suggested (Issue #6) a way for MarkdownLiteral to also accept raw strings, but this was not accepted. Thus, I need another way for MarkdownLiteral to accept LaTeX.
Since MarkdownLiteral uses @htl then @cm, its can require two levels of backslash protection in text: to get the effect of cm"\@at", one has to write @mdx "\\\\\\@at". (Again, this would be fixed with allowing MarkdownLiteral to accept raw strings.)
This brief Pluto notebook illustrates these issues, and shows that using result = htl" " in place of result = @htl` could fix 1&2. mdxTesting.zip
The text was updated successfully, but these errors were encountered:
Context: The CommonMark parser does not do interpolation into code, latex, or HTML environments. MarkdownLiteral.jl, by using
@htl
first, supports interpolation into those environments. But by working on Julia strings, and not giving the option to work on raw strings, it handles backslashes in unexpected ways.cm"``\LaTeX``"
must become@mdx "``\\LaTeX``"
cm"\@at"
must become@mdx "\\\\\\@at"
.Elaborating: Since Julia string processing uses backslash to escape characters, it does not play well with \LaTeX -- any backslashes have to be doubled. CommonMark avoids this by providing
cm" "
to operate on raw strings, socm"Text ``\LaTeX``"
can process MathJax inside the double back-ticks before the Julia string processing to the rest of the string. I suggested (Issue #6) a way for MarkdownLiteral to also accept raw strings, but this was not accepted. Thus, I need another way for MarkdownLiteral to accept LaTeX.Since MarkdownLiteral uses @htl then @cm, its can require two levels of backslash protection in text: to get the effect of
cm"\@at"
, one has to write@mdx "\\\\\\@at"
. (Again, this would be fixed with allowing MarkdownLiteral to accept raw strings.)This brief Pluto notebook illustrates these issues, and shows that using
result = htl" "
in place of result = @htl` could fix 1&2.mdxTesting.zip
The text was updated successfully, but these errors were encountered: