ronkok / Temml

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

Fix handling of empty superscripts and subscripts #60

Closed winstonewert closed 7 months ago

winstonewert commented 7 months ago

Temml raised an exception when I fed it an equation containing an empty superscript, e.g. $x^{}$. Its a weird but valid bit of LaTeX math.

The problem arose in some code that's directed at working around a Chromium bug in temml.cjs:7634. It attempts to look at the first child in a superscript to see if it needs to apply the fix. But if the superscript is empty, there is no first element. I added a check for an empty superscript here

ronkok commented 7 months ago

Yep, that's a bug. Your code fixes it and your tests are excellent. Nice work.

Temml's source code is in the temml/src/ subdirectory and this particular piece of code is in the supsub.js file. The Temml library needs a build step to bundle the code and build its final files.

I'll take it from here and issue an updated release tomorrow. I'm also writing an issue specifically so I can give you credit for finding the bug.

ronkok commented 7 months ago

This issue was handled instead by release v0.10.25.

winstonewert commented 7 months ago

Alright, if I find more bugs I'll try to edit the right files. Thanks for your prompt handling!

On Sun, Mar 31, 2024, 9:40 a.m. Ron Kok @.***> wrote:

This issue was handled instead by release v0.10.25.

— Reply to this email directly, view it on GitHub https://github.com/ronkok/Temml/pull/60#issuecomment-2028818346, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGRS7OQYMUOOTSP6JPV3NLY3A4BTAVCNFSM6AAAAABFP4X75GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYHAYTQMZUGY . You are receiving this because you authored the thread.Message ID: @.***>