Skip to content

Add MathML <a> handling to sanitization algorithms#12592

Draft
lukewarlow wants to merge 3 commits into
whatwg:mainfrom
lukewarlow:mathml-a-sanitization
Draft

Add MathML <a> handling to sanitization algorithms#12592
lukewarlow wants to merge 3 commits into
whatwg:mainfrom
lukewarlow:mathml-a-sanitization

Conversation

@lukewarlow

@lukewarlow lukewarlow commented Jun 17, 2026

Copy link
Copy Markdown
Member

Add MathML <a> handling to sanitization algorithm

(See WHATWG Working Mode: Changes for more details.)


/dynamic-markup-insertion.html ( diff )

@lukewarlow

Copy link
Copy Markdown
Member Author

cc @fred-wang I think the mathml core spec needs to expose the href, hreflang, and type attribute definitions for the mathml a element, like SVG does.

@fred-wang

Copy link
Copy Markdown
Contributor

@lukewarlow It seems the list of attributes for HTML and SVG is href, target, download, ping, rel, hreflang, type and referrerpolicy.

https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element
https://w3c.github.io/svgwg/svg2-draft/linking.html#AElement

I believe @tannal is also implementing some/all of these attributes in his CLs.

@lukewarlow

lukewarlow commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

Yes but only hreflang, type and href need referencing for now (as they're the ones that are safe for the more restricted sanitizer)

@zcorpan

zcorpan commented Jun 22, 2026

Copy link
Copy Markdown
Member

https://html.spec.whatwg.org/#inner-sanitize-steps currently sanitizes href and xlink:href on all MathML elements (since some previous MathML spec allowed any element to be a link).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants