Menu

#193 MathML equations without a namespace prefix are breaking paragraphs

v2.22
closed-fixed
None
5
2017-10-04
2017-10-03
Dan
No

I have the same MathML equation written twice, once with the "mml" namespace prefix, other without a namespace prefix.
The first one is left inline, as it should in the "p" element, the second is moved outside paragraph together with the content that follows it (a dot in my case).

This is the input:

<!DOCTYPE html>
<html>
    <head>
        <title>MathML equations should be left inline.</title>
    </head>
    <body>

        <h1>The quadratic formula</h1>
        <p>Should be inline:
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML">
                <mml:mi>x</mml:mi>
                <mml:mo>=</mml:mo>
            </mml:math>.
        </p>
        <p>Should be inline:
            <math xmlns="http://www.w3.org/1998/Math/MathML">
                <mi>x</mi>
                <mo>=</mo>
            </math>.
        </p>
    </body>
</html>

This is the output:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html
  xmlns:mml="mml">
  <head>
    <title>MathML equations should be left inline.</title>
  </head>
  <body>
    <h1>The quadratic formula</h1>
    <p>Should be inline: <mml:math
        xmlns:mml="http://www.w3.org/1998/Math/MathML">
        <mml:mi>x</mml:mi>
        <mml:mo>=</mml:mo>
      </mml:math>. </p>
    <p>Should be inline: </p>
    <math
      xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>x</mi>
      <mo>=</mo>
    </math>
    <p>. </p>
  </body>
</html>

This was not happening in the HC 2.7

Discussion

  • Scott Wilson

    Scott Wilson - 2017-10-03

    Thanks Dan. I think this was caused by an error in the Math element definition in the HTML5TagProvider. I've fixed this now, so this should be OK in the next release.

     
  • Scott Wilson

    Scott Wilson - 2017-10-03
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     I have the same MathML equation written twice, once with the "mml" namespace prefix, other without a namespace prefix. 
     The first one is left inline, as it should in the "p" element, the second is moved outside paragraph together with the content that follows it (a dot in my case).
    
    • status: open --> closed-fixed
    • assigned_to: Scott Wilson
    • Group: v2.21 --> v2.22
     
  • Dan

    Dan - 2017-10-04

    Thank you Scott!

     

Log in to post a comment.

MongoDB Logo MongoDB