pressbooks / pb-mathjax

A replacement for wp.com/latex.php but instead of LaTeX, it uses MathJax.
GNU General Public License v3.0
4 stars 1 forks source link

MathML comments double hyphen in webbook bug #8

Closed SteelWagstaff closed 5 years ago

SteelWagstaff commented 5 years ago

See Taylor's testing notes: https://docs.google.com/document/d/1JaPOKq-yHjJL3cBdmVcj8yh3RGAVt-4vq9F9C4mJ8gI/edit#bookmark=id.v8fygaoi6bij

dac514 commented 5 years ago

Test case:

<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow> <mi>x</mi><mo>=</mo><mfrac><mrow><mo form="prefix">−<!-- minus sign --></mo><mi>b</mi><mo>±<!-- &PlusMinus; --></mo><msqrt><msup><mi>b</mi><mn>2</mn></msup><mo>−<!-- minus sign --></mo><mn>4</mn><mo>⁢<!-- &InvisibleTimes; --></mo><mi>a</mi><mo>⁢<!-- &InvisibleTimes; --></mo><mi>c</mi></msqrt></mrow><mrow><mn>2</mn><mo>⁢<!-- &InvisibleTimes; --></mo><mi>a</mi></mrow></mfrac></mrow></math>

Webbook turns it into:

<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow> <mi>x</mi><mo>=</mo><mfrac><mrow><mo form="prefix">−<!- minus sign -->b±<!-- &PlusMinus; -->b2−<!-- minus sign -->4⁢<!-- &InvisibleTimes; -->a⁢<!-- &InvisibleTimes; -->c2⁢<!-- &InvisibleTimes; -->a --&gt;

😕

pkra commented 5 years ago

You can disable the hints in MathJax, cf. http://docs.mathjax.org/en/latest/options/hub.html?highlight=texhints.

dac514 commented 5 years ago

The problem was htmlLawed mangling mixed markup. (More info.)

Fixed in: https://github.com/pressbooks/pressbooks/commit/38aa0190252b752a9c010d27584eb2192882c9f4

mcgratay commented 5 years ago

Resolved.