Closed braindevices closed 2 years ago
Thanks, PanWriter preview is using KaTeX to render math... I'll try to update the KaTeX version...
Ah, actually the problem occurs only when this is the last thing on a line... appears to be an interaction between markdown-it-texmath and markdown-it-attrs.
var md = require('markdown-it')({});
md = md.use( require('markdown-it-attrs') ) // removing this line fixes it
md = md.use( require('markdown-it-texmath').use( require('katex') ) );
md.render('$rank_{x1}$');
inputting the above in node
, outputs:
<p x1=""><eq><span class="katex-error" title="ParseError: KaTeX parse error: Expected group after '_' at position 5: rank_̲" style="color:#cc0000">rank_</span></eq></p>
We've had one or two other cases where markdown-it-attrs
caused problems... so probably best to start digging there...
version: master, on ubuntu 20.04
expect:![Screenshot from 2021-03-23 23-54-24](https://user-images.githubusercontent.com/7507440/112229382-29f3db00-8c33-11eb-959b-0a0f81ace7d2.png)
actual result:![Screenshot from 2021-03-23 23-53-28](https://user-images.githubusercontent.com/7507440/112229373-27918100-8c33-11eb-99d1-d618de4432d1.png)