Skip to content

output/chtml component sometimes renders msubsup's superscript as a subscript if the real subscript is void/empty #2765

Closed
@EricDunsworth

Description

@EricDunsworth

Issue Summary

MathML's <msubsup> element is meant to contain three child elements that represent base, subscript and superscript. If the subscript is void and the superscript is filled-in, the superscript is still supposed to be treated as a superscript.

MathJax 3.2.0's output/chtml component seems to be prone to misrepresenting the msubsup element's superscript as a subscript if the real subscript is void or empty. But not always :S.

It seems to be dependant on nearby elements and which elements are used inside msubsup. In the reproduction steps below, I was able to provide examples that always render properly, always render improperly and one that renders differently depending on whether it precedes or follows other equations.

The input/mml and output/svg components seem to be unaffected. The accessibility extension always identifies superscripts correctly and the SVG renderer always renders them as such.

Steps to Reproduce:

JSBin examples:

Expected outcome:
All superscripts are rendered as superscripts (top-aligned).

Actual outcome:

  • The "Never works" example's superscript is rendered as a subscript (bottom-aligned).
  • The "Always works" example's superscript is rendered as a superscript (top-aligned).
  • The "2" superscript in the Cauchy-Schwarz Inequality appears as a subscript if that equation comes first.
  • The "2" superscript in the Cauchy-Schwarz Inequality appears as a superscript if that equation comes last.

Technical details:

  • MathJax Version: 3.2.0 (latest commit: 7146ffa)
  • Client OS: Windows 10
  • Browser: Edge 92.0.902.55, Firefox 92.0b9, Internet Explorer 11

Supporting information:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions