asciimath / asciimathml

A new home for asciimathml
http://asciimath.org/
MIT License
957 stars 183 forks source link

An exception occurs when using parseMath!The attribute "mathvariant" is incorrect! #131

Open masx200 opened 2 years ago

masx200 commented 2 years ago
<script src="https://cdn.jsdelivr.net/gh/asciimath/asciimathml@master/ASCIIMathML.min.js"></script>
console.log(asciimath.parseMath('sum_(i=1)^n i^3=((n(n+1))/2)^2'))
<math title="sum_(i=1)^n i^3=((n(n+1))/2)^2"><mstyle mathcolor="blue" fontsize="1em" mathsize="1em" fontfamily="serif" mathvariant="serif" displaystyle="true"><mi>s</mi><mi>u</mi><mi>m</mi><mo>_</mo><mo>(</mo><mi>i</mi><mo>=</mo><mn>1</mn><mo>)</mo><mo>^</mo><mi>n</mi><mi>i</mi><mo>^</mo><mn>3</mn><mo>=</mo><mo>(</mo><mo>(</mo><mi>n</mi><mo>(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo>)</mo><mo>)</mo><mo>/</mo><mn>2</mn><mo>)</mo><mo>^</mo><mn>2</mn></mstyle></math>

The attribute "mathvariant" is incorrect! "serif"

https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mi

mathvariant This logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed: normal (Default value for more than one character) ; Example bold ; Example italic (Default value for a single character) ; Example bold-italic ; Example double-struck ; Example bold-fraktur ; Example script ; Example bold-script ; Example fraktur ; Example sans-serif ; Example bold-sans-serif ; Example sans-serif-italic ; Example sans-serif-bold-italic ; Example monospace ; Example initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال

masx200 commented 2 years ago

截图_选择区域_20210726205909 The way it transforms is obviously wrong!