Closed Hydrostic closed 3 years ago
This issue still persists. I tested and found that the issue is present with div
but not with span
blocks.
This is an issue because
Run below in Node.js REPL.
tm = require('markdown-it-texmath'),
md = require('markdown-it')({html: true}).use(tm, { engine: require('katex'),
delimiters:'dollars',
katexOptions: { macros: {"\\RR": "\\mathbb{R}"} }
});
md.render('<p>$1$</p>')
'<p><eq><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">1</span></span></span></span></eq></p>\n'
'<p>$1$</p>'
This behavior is markdown-it specific by intention.
So
<p>*italic*</p>
as well as
<p>
*italic*
</p>
won't render markdown inside of html elements. It will show
*italic*.
But inserting blank lines before and after a markdown block inside of html elements will render markdown properly
<p>
*italic*
</p>
resulting in italic.
So this is not an issue, but from markdown-it by design.
When latex text is in
<p>
block, it doesn't try to render But if i put it out of the<p>
, it's OK