Mathjax re-rendering duplicates equation
Hallo,
editing an equation in a file that is being previewd does not seem to work properly:
- after the edit the original equation is still being shown and the LaTeX code for the modified equation is displayed above it.
- after modifying a different part of the document the modified equation is being rendered and displayed above the orignial one.
pictures:
I'm having a similar issue, as well as related issues. The problem is that WrappedDomTree.diffTo returns the #text node of the .math.inline node generated by pandoc. Since it is returned as a replacement and not an insertion, the frontend will not attempt to re-render it (through a call to MathJax.Hub.Typeset).
Sadly I'm not familiar enough with the code that does the diffing, but it appears to me that we would have to find a way for the .math.inline node to get tagged as changed instead of its #text node. This way, we would be able to replace said node in the DOM and have MathJax typeset it.
I ended up finding a temporary solution that works for me (no change highlighting but no double rendering issues). See TomzxForks/markmon@468fd59f21f274930eced7eb6ab91ef5d822697a.