markmon icon indicating copy to clipboard operation
markmon copied to clipboard

Mathjax re-rendering duplicates equation

Open Cydox opened this issue 9 years ago • 2 comments

Hallo,

editing an equation in a file that is being previewd does not seem to work properly:

  1. after the edit the original equation is still being shown and the LaTeX code for the modified equation is displayed above it.
  2. after modifying a different part of the document the modified equation is being rendered and displayed above the orignial one.

pictures: 1 2 3

Cydox avatar Jul 03 '16 15:07 Cydox

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.

tomzx avatar Sep 16 '16 20:09 tomzx

I ended up finding a temporary solution that works for me (no change highlighting but no double rendering issues). See TomzxForks/markmon@468fd59f21f274930eced7eb6ab91ef5d822697a.

tomzx avatar Sep 16 '16 20:09 tomzx