Skip to content

Bad Canonicalization for bad input #475

@NSoiffer

Description

@NSoiffer

This disaster of real world input:

<math xmlns="http://www.w3.org/1998/Math/MathML">
    <mi>S</mi><mi>I</mi><msup><mi>N</mi><mrow data-mjx-texclass="ORD"><mo>−</mo><mn>1</mn></mrow></msup>
    <mo>,</mo><mtext> </mtext>
    <mi>C</mi><mi>O</mi><msup><mi>S</mi><mrow data-mjx-texclass="ORD"><mo>−</mo><mn>1</mn></mrow></msup>
    <mtext>,</mtext>
</math>

ends up producing bad canonical MathML:

   <math>
    <mrow data-changed='added'>
      <msup>
        <mi data-maybe-chemistry='1' mathvariant='normal' data-split='true'>SIN</mi>
        <mrow data-mjx-texclass='ORD'>
          <mo>-</mo>
          <mn>1</mn>
        </mrow>
      </msup>
      <msup data-previous-space-width='0.7'>
        <mo>,</mo>
        <mi>COS</mi>
        <mrow data-mjx-texclass='ORD'>
          <mo>-</mo>
          <mn>1</mn>
        </mrow>
      </msup>
      <mo>,</mo>
    </mrow>
   </math>

Notice that the second <msup> has three arguments.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingrustCoding in Rust

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions