Skip to content

process MathML nested inside mtext #3583

Description

@xworld21

Is your feature request related to a problem? Please describe.
The <mtext> element is allowed to contain arbitrary HTML, and this is now properly supported via allowHtmlInTokenNodes. There are two inconsistencies, though:

  1. if a <math> element appears as direct children of <mtext>, MathJax returns the error 'Improper nesting of math tags'
  2. otherwise, <math> is accepted, but MathJax does not process it

Describe the solution you'd like
<math> descendants of <mtext> should be processed like any other <math>.

Describe alternatives you've considered
To work around 1, it is enough to generate better MathML and split <mtext>, or to wrap the content into a further <div>. For 2, MathML support in browsers is not too bad. So all in all this is a minor issue.

Additional context
This is a rare circumstance, as far as I know. The mathtools documentation has an (artificial!) LaTeX example that can't be replicated properly without nesting MathML-in-HTML-in-MathML, but I haven't encountered it in practice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code ExampleContains an illustrative code example, solution, or work-aroundFeature Requestv4

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions