Browse Source

feat(sanitizer): add MathML tags to the sanitizer

This was found by reading the article pointed by https://lobste.rs/s/nobvmp/how_prime_factorizations_govern_collatz
jvoisin 11 months ago
parent
commit
d1dc369bb2
1 changed files with 32 additions and 0 deletions
  1. 32 0
      internal/reader/sanitizer/sanitizer.go

+ 32 - 0
internal/reader/sanitizer/sanitizer.go

@@ -77,6 +77,38 @@ var (
 		"var":        {},
 		"video":      {"poster", "height", "width", "src"},
 		"wbr":        {},
+
+		// MathML: https://w3c.github.io/mathml-core/ and https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element
+		"annotation":     {},
+		"annotation-xml": {},
+		"maction":        {},
+		"math":           {},
+		"merror":         {},
+		"mfrac":          {},
+		"mi":             {},
+		"mmultiscripts":  {},
+		"mn":             {},
+		"mo":             {},
+		"mover":          {},
+		"mpadded":        {},
+		"mphantom":       {},
+		"mprescripts":    {},
+		"mroot":          {},
+		"mrow":           {},
+		"ms":             {},
+		"mspace":         {},
+		"msqrt":          {},
+		"mstyle":         {},
+		"msub":           {},
+		"msubsup":        {},
+		"msup":           {},
+		"mtable":         {},
+		"mtd":            {},
+		"mtext":          {},
+		"mtr":            {},
+		"munder":         {},
+		"munderover":     {},
+		"semantics":      {},
 	}
 )