Commit f04abc6b authored by Kunpei Sakai's avatar Kunpei Sakai Committed by Nigel Tao

html: add missing special elements for <svg> and <math>

See: https://html.spec.whatwg.org/multipage/parsing.html#special

Change-Id: Ief3f0c04d2c7530a44221cb8fa2e22dd6d8b8427
Reviewed-on: https://go-review.googlesource.com/136876Reviewed-by: 's avatarNigel Tao <nigeltao@golang.org>
parent cf3bd585
...@@ -97,8 +97,16 @@ func isSpecialElement(element *Node) bool { ...@@ -97,8 +97,16 @@ func isSpecialElement(element *Node) bool {
switch element.Namespace { switch element.Namespace {
case "", "html": case "", "html":
return isSpecialElementMap[element.Data] return isSpecialElementMap[element.Data]
case "math":
switch element.Data {
case "mi", "mo", "mn", "ms", "mtext", "annotation-xml":
return true
}
case "svg": case "svg":
return element.Data == "foreignObject" switch element.Data {
case "foreignObject", "desc", "title":
return true
}
} }
return false return false
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment