-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add a mdx_str version so that latex backslashes need not be escaped #5
Comments
mdx"
\LaTeX
"
instead of @mdx "
\\LaTeX
"
I have a possible fix to stop |
Thanks for your contribution @snoeyink ! Unfortunately we made the design decision to not add a To avoid this frustrating experience, and confusion over two similar but different syntaxes, we only offer the |
Could you open a new issue about the backslash problem? In general, we found that it helps in open source discussions to split a problem statement from a feature request. By stating a problem, you encourage others to contribute creative solutions, while a direct feature request locks the discussion in to a single direction. |
@fonsp You are interacting with packages that supply cm" " and htl" ", so it is frustrating and confusing not to have mdx" ". I need a way to send raw strings into the interpolation pipeline so that Julia string processing doesn't try to interpret all my \LaTeX before it is ready. All my slides depend on this. Ok, I will open a separate issue, but to me the consistency with CommonMark and HypertextLiteral suggests the opposite design decision. |
Request: Please add a
mdx_str
version of@markdown
so I can writemdx" ``\LaTeX``"
instead of@mdx "``\\LaTeX``"
. I've spent several hours playing with escaping and un-escaping strings, discovering differences in the interpolation parsing betweenhtl" "
andcm" "
, and realizing that I am too new to Julia/Pluto to do this properly. But I think I can see what can be done:Issue: CommonMark.jl provides
cm" "
, which means that one need not escape backslashes for latex, for example. It's parser does not do interpolation into code, latex, or HTML environments. MarkdownLiteral.jl, by using@htl
first, supports interpolation into those environments, but at the cost of not working on raw strings, so things like latex have to be properly escaped.mdx"``\LaTeX``"
to work likecm"``\LaTeX``"
, but at the moment I need to write@mdx "``\\LaTeX``"
.@htl
is followed by the cm_parser means that to get the effect ofcm"\@at"
, I have to write@mdx "\\\\\\@"
, whereasmdx"\@at"
I expect will just work.\$
:cm"\$3.50" #-> "$3.50"
, as expected. Somehow@mdx "\$3.50"
works, but special handling may be needed formdx"\$3.50"
, sincehtl"\$3.50"
fails with an interpolation error andhtl"\$(3.50)" #-> "\3.5"
.Thanks: MarkdownLiteral.jl is a really elegant hack that puts me very close to being able to convert all my Discrete Structures book & slides to markdown in Pluto notebooks. Issue 3 suggests that it may be better to first interpolate, then clean the html, then parse markdown, but I think that just having an mdx" " version would already be a big help.
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: