MathML wrong for expression with |
Description
The MathML for {x^2}+2x|_{x=3} is wrong:
<mrow><msup><mi extid="e842v2">x</mi><mn extid="e842v3">2</mn></msup><mo extid="e842v4">+</mo><mn extid="e842v5">2</mn><mo>⁢</mo>
<mi extid="e842v6">x</mi>
<mo>⁢</mo>
<msub><mo extid="e842v7">∣</mo><mrow><mi extid="e842v8">x</mi><mo extid="e842v9">=</mo><mn extid="e842va">3</mn></mrow></msub></mrow>
The ⁢ before the subscripted | is wrong. It should get added between operands. For sub/superscripts, you should look usually look at the base and see if it is an operand or operator. In this case, | is an operator, so should not add the ⁢.
In various cases, when operators are prefix or postfix, they can act as an operand, but in this case, | acts like a postfix operator and should not be treated as an operand. E.g, in 3!*-4, ! is a postfix operator so that the subexpression to the left of the * is an operand. Similarly, the - (in this case) is a prefix operator, so the subexpression to the right of the * is an operand. Of course, the * is explicit multiplication, so ⁢ doesn't need to be added. However, it would be added in an expression like 3!(-4).