You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mathml-safe-list.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -5,22 +5,22 @@ MathML-core considers all elements and attributes of MathML-core (as listed in [
5
5
6
6
We recommend the [Sanitzer API](https://wicg.github.io/sanitizer-api/) to sanitize MathML by keeping all elements and attributes except the follwing:
7
7
- any common attribute with HTML attributes for which need a sanitzation as done in HTML,
8
-
- the `mphantom` elements which should, ideally, be kept or replaced by an empty `mspace` element
9
-
- the `maction` elements which should, ideally, be replaced by an `mrow` element with the same children, and
10
-
- any `annotation` or `annotation-xml` element whose `encoding` attribute is of a media-type that is is either absent or is not among the trusted types or if it contains an `href` attribute: the element should, then, be removed.
8
+
- the `mphantom` elements which should, ideally, be kept or replaced by an empty `mspace` element; if these replacements are not possible, the element should be removed.
9
+
- the `maction` elements which should, ideally, be replaced by an `mrow` element with the same children or, if this replacement is not possible, should be replaced by its child nodes and
10
+
- any `annotation` or `annotation-xml` element whose `encoding` attribute is of a media-type that is is either absent or is not among the trusted types or if it contains an `href` attribute: the element should be removed.
11
11
12
12
### Detailed Version
13
13
MathML-core considers the following elements and attributes of MathML-core as safe and not needing sanitization:
`dir, displaystyle, mathbackground, mathcolor, mathsize, scriptlevel, encoding, display, linethickness, intent and arg`; on `mo` elements: `form, fence, separator, lspace, rspace, stretchy, symmetric, maxsize, minsize, largeop, movablelimits`; on `mpadded` elements: `width, height, depth, lspace, voffset`, on `mspace` elements: `width, height, depth`, on `munderover` elements `accent` and `accentunder`; on `mtd` elements `columnspan` and `rowspan`.
20
20
21
21
Moreover, the following attributes have their syntax and semantics specified in the HTML specification. The sanitizer behaviour on these attributes should be as is done on HTML elements: `on*, id, class, style, data-*, autofocus, nonce,tabindex` (for example any javascript should be removed).
22
22
23
23
The elements of MathML-core which need treatment by the sanitizers are the following. The proposed replacements are expressed in order of preference:
24
-
- the `mphantom` elements which should, ideally, be kept or replaced by an empty `mspace` element; if no other possibility exists, then remove it,
25
-
- the `maction` elements which should, ideally, be replaced by an `mrow` element with the same children; if no other possibility exists, then remove it, and
26
-
- any `annotation` or `annotation-xml` element whose `encoding` attribute is of a media-type that is is either absent or is not among the trusted types or if it contains an `href` attribute: the element should, then, be removed.
24
+
- the `mphantom` elements which should, ideally, be kept or replaced by an empty `mspace` element; if this replacement is not possible, the element should be removed it,
25
+
- the `maction` elements which should, ideally, be replaced by an `mrow` element with the same children; if this replacement does not exist, then replace by its child nodes, and
26
+
- any `annotation` or `annotation-xml` element whose `encoding` attribute is of a media-type that is is either absent or is not among the trusted types or if it contains an `href` attribute: the element should be removed.
0 commit comments