mirror of
https://github.com/golang/net.git
synced 2026-04-01 02:47:08 +09:00
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/136876 Reviewed-by: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
@@ -97,8 +97,16 @@ func isSpecialElement(element *Node) bool {
|
||||
switch element.Namespace {
|
||||
case "", "html":
|
||||
return isSpecialElementMap[element.Data]
|
||||
case "math":
|
||||
switch element.Data {
|
||||
case "mi", "mo", "mn", "ms", "mtext", "annotation-xml":
|
||||
return true
|
||||
}
|
||||
case "svg":
|
||||
return element.Data == "foreignObject"
|
||||
switch element.Data {
|
||||
case "foreignObject", "desc", "title":
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user