Closed SteelWagstaff closed 5 years ago
As an example, see this chapter of a Saylor book: https://saylordotorg.github.io/text_introductory-statistics/s06-01-three-popular-data-displays.html. It can be imported to PB using the HTML import routine, but the product looks like: https://university.pressbooks.pub/import/chapter/three-popular-data-displays/. Images are included, but MathML is not. If the user copy/pastes the source into Pressbooks, MathML works, but images (which have relative links) do not. See: https://integrations.pressbooks.network/testbookfun/chapter/three-popular-data-displays/
This is fixed with the slogan "Not all imports are sanitized equal."
$allowedposttags
, wp_filter_post_kses
MathML rules.The rules in Step 2 are based on WordPress role. The principle is the same as why superadmin can paste whatever HTML they want in TinyMCE, but an editor cannot.
Using the example URL, super admin will import:
<math xml:id="fwk-shafer-ch02-m0001" display="block">... snip ...
An editor:
<math display="block">... snip ...
Synonym of technically, assuming our custom MathML + kses rules are on purpose, there's no difference.
Resolved.
When a html file containing MathML is imported to Pressbooks using the html import routine, the MathML is stripped out or sanitized so that it no longer displays as expected. Users must instead copy/paste the html source into the text editor. Ideally, MathML would be able to pass through the import and ingestion routine unchanged.