-
Notifications
You must be signed in to change notification settings - Fork 76
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
🐛 Bug: Support MathJax custom tags #50
Comments
I don't think getting the content between the So a
I won't add this plugin anytime soon, as it would be a lot of work. But this plugin should exist! Ideally maintained by someone better in math than me 😅 I'm planning a v2 of the library. Maybe I will add it then... You could already help by collecting various snippets from websites you encounter. This should cover a variety of uses (e.g. client-side-rendering, server-side-rendering, different libraries, content that looks like math but is NOT, ...) See this file as an example. It follows this pattern:
|
Thanks for implementing #49 so quickly! Yeah, MathJax supports LaTeX-Style, MathML as well as AsciiMath. Converting MathML to Markdown however is probably quite much work. Simply "passing through" dollar-signs if so-configured in the scripts may work "good enough" for most use cases though? I've just noticed that pandoc can do just the thing:
You can also choose
Which works good enough for my use cases for now. Adding real Regardless, I will collect examples I stumble upon :) |
Describe the bug
MathJax is a JavaScript library allowing to add "custom tags" such as
$...$
to HTML which will then be turned into e.g., MathML or whatever the browser supports.Depending on the Markdown implementation math is either not supported at all -- or directly through the same syntax. Either way, it'd probably make most sense to simply keep
$...$
expressions intact and not escape strings contained therein. While a simple filter for that would certainly work, MathJax allows supporting different escape characters than$...$
for inline- and$$...$$
for display-math, e.g., from the article https://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/:This would necessate parsing Js though ...
HTML Input
Generated Markdown
some formula: $\\lambda$
Expected Markdown
Additional context
This filter (or "unfilter") may be only activated, if MathJax is detected, and otherwise disabled. Further, as mentioned earlier, a more sophisticated parsing of the HTML may be used to detect the precise math-HTML tags used or make them configurable at the least.
The text was updated successfully, but these errors were encountered: