ronkok / Temml

TeX-to-MathML conversion library in JavaScript
https://temml.org/
MIT License
162 stars 12 forks source link

TypeError `Cannot set property 'display' of undefined` in Qt WebEngine #65

Open capital-G opened 6 months ago

capital-G commented 6 months ago

Hi,

I took a look at if Temml could work under a Qt WebEngine browser and it works, although setting display mode to true generates an error and does not generate an output.

*** JavaScript Message: "Uncaught TypeError: Cannot set property 'display' of undefined"
* line: 608
* source ID: "file:///Users/scheiba/Library/Application%20Support/SuperCollider/Help/lib/temml-0.10.27/temml.js"

I commented out said line

https://github.com/ronkok/Temml/blob/57c88a78600dde93d7c661029a9f52d55bfa99b5/src/mathMLTree.js#L64

and then it started working.

The qt version I used was 5.15.10. which has the navigator.userAgent

Mozilla/5.0 (Macintosh; Intel Mac OS X 13_6_6)
AppleWebKit/537.36 (KHTML, like Gecko)
QtWebEngine/5.15.11
Chrome/87.0.4280.144
Safari/537.36

I used the temml-0.10.27.

Do you have an idea what could be the problem in this case?

ronkok commented 6 months ago

I do not have QT browser. If you work with me a little, maybe we can narrow down the source of this bug.

In file temml.js, try commenting out line 2338, math.style.display = "block math";. Let me know if Temml will then work.