Page MenuHomePhabricator

TeX macro "\ " not inserting space in MathML and client-side MathJax
Closed, ResolvedPublicBUG REPORT

Description

Enable "MathML (experimental; no images)" or "Client side MathJax rendering" in Special:Preferences → Apperance → Math. Then preview a page with the contents <math>a\ b \quad xy</math>
I expect to see more spacing between "a" and "b" than between "x" and "y", but it's actually the same spacing.

The issue is that \ is translated into <mspace linebreak="newline"> instead of <mphantom> </mphantom> to ensure it has the same width as a space character.

Firefox rendering :

Screenshot 2024-12-16 at 17.08.11.png (326×626 px, 28 KB)

Event Timeline

This also seems to be a regression. I think the use mspace is correct, however the width attribute is missing.

temml: generates <mtext>&nbsp;</mtext>
latexml generates <mo lspace="0.500em" id="p1.1.m1.1.1.1" xref="p1.1.m1.1.1.1.cmml">⁢</mo>
mathoid (previous version of this) <mtext>&nbsp;</mtext>

I suggest we keep the mtext element.

The issue regarding spacing between a\b and xy in MathML and client-side MathJax has been tested successfully.

    1. Steps to Verify:
  1. Enabled Math Rendering Modes:
    • MathML (experimental; no images)
    • Client-side MathJax rendering
  2. Tested input: <math>a\ b \quad xy</math>
  3. Result:
    • Correct spacing is now observed between a and b.
    • The spacing matches expectations.

Notes:

The bug seems resolved successfully. Please review the result.

Screenshot 2024-12-16 223121.png (396×972 px, 67 KB)

Change #1105968 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Fix space rendering

https://gerrit.wikimedia.org/r/1105968

Change #1105986 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Refactor BaseMappings operators

https://gerrit.wikimedia.org/r/1105986

Change #1105968 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Fix space rendering

https://gerrit.wikimedia.org/r/1105968

Change #1105986 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Refactor BaseMappings operators

https://gerrit.wikimedia.org/r/1105986

Change #1109186 had a related patch set uploaded (by Krinkle; author: Physikerwelt):

[mediawiki/extensions/Math@REL1_43] Fix space rendering

https://gerrit.wikimedia.org/r/1109186

Change #1109186 merged by jenkins-bot:

[mediawiki/extensions/Math@REL1_43] Fix space rendering

https://gerrit.wikimedia.org/r/1109186

Change #1110461 had a related patch set uploaded (by Krinkle; author: Physikerwelt):

[mediawiki/extensions/Math@REL1_43] Refactor BaseMappings operators

https://gerrit.wikimedia.org/r/1110461

Change #1110461 merged by jenkins-bot:

[mediawiki/extensions/Math@REL1_43] Refactor BaseMappings operators

https://gerrit.wikimedia.org/r/1110461