Directionality of text is not respected in MathML output
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
dir attribute can be used to change the text direction even on individual MathML elements. MathJax does not respect this in rendering.
MathJax 4 output:
Expected output (Firefox's native):
OS: Windows 11
Browser: Mozilla Firefox 153.0
Steps to Reproduce:
Render the code:
<math xmlns="http://www.w3.org/1998/Math/MathML" dir="rtl">
<mi>n</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mn>1</mn>
<mo>+</mo>
<msqrt>
<mn>5</mn>
</msqrt>
</mrow>
<mn>2</mn>
</mfrac>
</math>
Attribute dir="rtl" should make so that the text direction changes.
Technical details:
- MathJax Version: 4
- OS: Windows 11
- Browser: Mozilla Firefox 153.0
I am using the default following MathJax configuration and and 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 loading the provided MathML example through tex-mml-chtml.js and compare the MathJax output with Firefox's native rendering. Trace how the MathML dir attribute is handled during output generation, then verify that dir="rtl" on an individual MathML element changes the rendered direction and add regression coverage for the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100