Skip to content

SVG renderer forces inline breaks when MathML is wrapped in semantics #3428

@xworld21

Description

@xworld21

Issue Summary

The combination of MathJax 4, inline breaks, SVG renderer, and MathML content that is wrapped in <semantics> seems to generate forced line breaks where optional breaks should be.

Steps to Reproduce:

Simple example tested on mathjax.org/#demo:

<math display="inline"><semantics><mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow></semantics></math>

in SVG becomes
Image

The browser inspector shows the following elements:

<mjx-break prebreak="true" aria-hidden="true"> </mjx-break>
<mjx-break newline="true" aria-hidden="true"> </mjx-break>

Removing the <semantics> wrapper, or using the CHTML renderer, works around the issue.

Technical details:

  • MathJax Version: 4.0.0
  • Client OS: Windows 11
  • Browser: Chrome 139.0.7258.157

I am reproducing this on https://www.mathjax.org/#demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedIssue has been reproduced by MathJax teamCode ExampleContains an illustrative code example, solution, or work-aroundMergedMerged into develop branchv4

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions