mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Distinguish block math from inline math #128
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 @BOT-Man-JL on GitHub (Aug 13, 2017).
Current version of markdig renders both
$...$pair and$$...$$pair into<span class="math">...</span>uniformly. But many math engines treat them differently...For example, MathJax support this:
😉 It will be very helpful for LaTeX guys...
@BOT-Man-JL commented on GitHub (Aug 13, 2017):
will be rendered into
@BOT-Man-JL commented on GitHub (Aug 13, 2017):
works...
@xoofx commented on GitHub (Aug 13, 2017):
Yes, this is the expected behavior of the current code as explained in the Mathematics extension
$and$$can be used for inline/span maths inside the same line (but$$cannot start a line)$$can be used as a block if it is declared alone on a line (like fenced code blocks)@BOT-Man-JL commented on GitHub (Aug 14, 2017):
The current specs is a bit different from what I usually use...
And MathJax and KaTeX (with auto renderer) support
$$block in the same line... 😕Here is a guideline of MathJax on StackExchange: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference
@xoofx commented on GitHub (Aug 14, 2017):
Oh, then it makes sense to make
$$always a block, no problem, will fix that...@BOT-Man-JL commented on GitHub (Aug 15, 2017):
Oh, thanks 😄 It would be convenient to type short equations inside
$$@xoofx commented on GitHub (Aug 30, 2017):
I have a remaining issue with this approach though. A
$$inside a paragraph should not generate a<div>as a paragraph is already a<p>and this is a HTML error to have adivinside apelement. We could emit a span with a classmathand an additionalblockto mark that this span content should be display as a block instead (display: block;)@BOT-Man-JL commented on GitHub (Aug 30, 2017):
Well, KaTeX adds class
katex-displayand MathJax addsMJXc-displaytospantag if there is an block math code... So I think an additional class works. (math engine always reads the class name in CSS...)display: blockis another good solution, which will have effect directly in plain HTML. 😄