Open CAD97 opened 6 years ago
What does GitHub do?
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}
\,d\xi
<pre lang="math,katex"><code>f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}
\,d\xi
</code></pre>
Reusing class="language-katex"
is probably not a good idea, as that should render the code block as katex
code, not interpret it. Same with class="language-asciimath"
. Someone might do syntax highlighting for it, or want to show off their asciimath code.
Inline math is a lot more up in the air.
I chose $1+1
$, as its fallback to code-blocks parallels what seems like the obvious choice for display-style, that is the <code>
block with class language-math
, as that's what it is. But for inline code blocks, CommonMark doesn't give a way to specify the class of the rendered HTML node.
If we add AsciiMath, then we need different markers for inline AsciiMath.
If we decide to support AsciiMath (#1), then the display-math
```math
is ambiguous.Options:
```katex
and```asciimath
(orlatex
), which becomeclass="language-katex"
andclass="language-asciimath"
in html```math
and```asciimath
, which becomeclass="language-math"
andclass="language-asciimath"
```math,katex
and```math,asciimath
, which I think becomesclass="language-math,katex",
class="language-math,asciimath"` -- That's what the reference implementation outputs, anyway.If that's what pulldown-cmark does, then I think the third option is the best one.