grav-plugin-mathjax
grav-plugin-mathjax copied to clipboard
1.6.0 Regression: Formulas are not rendered within HTML
Formulas are not rendered with MathJax if they are enclosed in HTML code.
This (HTML)-code is simply interpreted as HTML code. MathJax does not render the formula.
<p>Test ... $x^2$ ...bla..bla...</p>
This (MarkDown)-code is rendered by MathJax as expected.
Test ... $x^2$ ...bla..bla...
Expected behavior: In both cases formulas are rendered with MathJax.
Regression / Incompatibility with Grav TinyMCE Plug-in (Version 1.5.1 has been compatible with TinyMCE)
Hey @Thunderbolt32 ,
well this is because previous versions just rendered math expressions even when they were not preprocessed. This has changed in v1.6.0, more specifically here mathjax.js. You can restore the previous behaviour either by setting built_in_js: false
and provide your own mathjax.js in the theme and add
// Array of pairs of strings that are to be used as in-line math delimiters
inlineMath: [ ['\\(','\\)'], ['$', '$'] ],
// Array of pairs of strings that are to be used as delimiters for displayed equations.
displayMath: [ ['\\[','\\]'], ['$$', '$$'] ],
or set
<p markdown="1">Test ... $x^2$ ...bla..bla...</p>
The attribute invokes the parser to check for markdown tags in the content. You can also switch to \( ... \)
for inline and \[ ... \]
for block code, which still works as expected (even without the html attribute).