View Single Post
Old 06-14-2021, 04:45 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,911
Karma: 6120478
Join Date: Nov 2009
Device: many
I spent most of today looking at this. It is going to be a bear to fix.

MathJax just inserts so much crap that any type of cfi or element path will be wrong. Very wrong. And it gets worse the more equations are in the file.

If I turn off just about all the crap as I can, it still wraps each math node in a script tag of type math/mml and it adds 2 divs at the top as the first two children of the body. One div is required as it has the svg paths and glyphs needed. The other is just a stupid message field that can not be deleted even if your set showMessages to false and to not display. Even worse the Mathjax java script code will constantly recreate it even if has been deleted and set not to be used.

So the only approach that might work is to register a start-up hook for when mathjax ends and then create some javascript to remove all of the extra script tags added to wrap the math ml tags from the dom, then remember if using mathml and if so compensating for the two extra first children of the body when passing a location into Preview and do the reverse when passing a location out of Preview to CV.

What a mess! All because Chrome decided to kill all support for true native mathml in the browser.

Last edited by KevinH; 06-14-2021 at 04:47 PM.
KevinH is online now   Reply With Quote