Math input error when mixing MathML and a HTML hyperlink
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Issue Summary
MathJax 4 produces a math input error when rendering a MathML equation that also has other HTML elements in it.
OS: Windows 11
Browser: Mozilla Firefox 153.0
Expected output (using Firefox's native rendering):
Steps to Reproduce:
Render the MathML equation in question:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mo>|</mo>
<mi>x</mi>
<mo>+</mo>
<mi>y</mi>
<mo>|</mo>
<mo><</mo>
<mo>|</mo>
<mi>x</mi>
<mo>|</mo>
<mo>+</mo>
<mo>|</mo>
<mi>y</mi>
<mo>|</mo>
<mtext>
<sup>
<a href="https://en.wikipedia.org/wiki/Triangle_inequality">Triangle inequality (Wikipedia)</a>
</sup>
</mtext>
</math>
It is a bug, since it should be possible to have HTML markup inside MathML markup as per MathML Core 2.2.1 HTML and SVG.
Technical details:
- MathJax Version: 4
- OS: Windows 11
- Browser: Mozilla Firefox 153.0
I am using the following the default MathJax configuration.
Loading MathJax via:
<script src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js" defer></script>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided MathML example with MathJax 4's default tex-mml-chtml.js configuration in Firefox, then trace the math input error triggered by the HTML hyperlink inside mtext. Done means the equation renders without an input error while retaining the hyperlink.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100