[go: up one dir, main page]

Don't strip MathML from KaTeX-rendered markup

The following discussion from !59132 (merged) should be addressed:

  • @markrian started a discussion:

    It turns out that KaTeX by default renders HTML and MathML, the former for visual rendering, and the latter for accessibility. This DOMPurify ALLOWED_TAGS option actually ends up stripping out any MathML rendered by KaTeX.

    We'd probably prefer to keep the rendered MathML in place. I'll open up a follow-up issue to track this.

Possible solutions

  1. Manually add MathML tags to the ALLOWED_TAGS list
  2. Adopt the USE_PROFILES option (though apparently that overrides the ALLOWED_TAGS option, so this might not be a good idea)
Edited by Mark Florian