mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-11 13:54:50 +00:00
UseMathematics and MathJax #272
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RickStrahl on GitHub (Feb 15, 2019).
I'm playing around with Markdig for using Math expressions and am using MathJax, which seems to be the most popular Web based Math library. A number of math equation creation tools all are using this library to power their previews.
The current MarkDig
MathExtensionworks in parsing$$and$to<div class="math">(and<span>) but this turns out to be a problem with MathJax as it expect HTML expressions to start with some sort of block statement.You can check this out here:
https://www.mathjax.org/#demo
The following does not work:
but this does:
MathJax seems pretty popular and is by far the easiest to integrate with easily, so this should probably be supported in some way - either as a separate extension or maybe with a flag on the
UseMath()builder extension perhaps.I played around with creating a custom extension based on the existing
MathExtensionand the following does seems to work well:Any thoughts on whether this makes sense to integrate in some way? My code is probably not efficient in the pipeline. Also I think if this sounds like a good idea it would also seem like a good idea to handle raw
<div class="html">blocks in the Markdown and perhaps auto-inject the thebegin{}\end{}lines to make it more universal.