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 & visual editor research spike [don't break] #7

Closed SteelWagstaff closed 5 years ago

SteelWagstaff commented 5 years ago

Switching between the visual and text editors strips out semantic MathML tags. In a timeboxed way, investigate whether we can stop this from happening, or report the issue upstream to be fixed.

dac514 commented 5 years ago

Switching between the visual and text editors breaks MathML tags We can stop this from happening by forcing the MathML into one line without any returns

mcgratay commented 5 years ago

√ MathML written in hierarchy instead of in one line without breaks now does display correctly. X Semantic tags are still stripped out when you switch between the visual and text editors. See image for before and after

Screen Shot 2019-06-26 at 2 20 00 PM

dac514 commented 5 years ago

Added "Content Markup" to allowed tags.

mcgratay commented 5 years ago

The editor no long strips out content markup/semantic tags when you switch from text to visual and back. However, semantic tags (which still exist) will not be visible in the visual editor as a rendered equation like presentational tags are.

See: https://testbook2948593.textopress.com/wp/wp-admin/post.php?post=188&action=edit Screen Shot 2019-06-28 at 3 51 35 PM

Screen Shot 2019-06-28 at 3 48 58 PM

dac514 commented 5 years ago

@mcgratay I think that's the expected behaviour for web browsers:

The term presentation markup is used to describe the layout structure of mathematical notation whereas content markup provides the underlying mathematical meaning and is not supposed to be rendered by the MathML parser (see bug 276028).

https://developer.mozilla.org/en-US/docs/Web/MathML/Element https://bugzilla.mozilla.org/show_bug.cgi?id=276028

mcgratay commented 5 years ago

👍

Also note that I forgot to wrap that last presentational one in <math>