1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // Section 12.2.3.2 of the HTML5 specification says "The following elements
8 // have varying levels of special parsing rules".
9 // https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements
10 var isSpecialElementMap = map[string]bool{
55 "isindex": true, // The 'isindex' element has been removed, but keep it for backwards compatibility.
96 func isSpecialElement(element *Node) bool {
97 switch element.Namespace {
99 return isSpecialElementMap[element.Data]
101 return element.Data == "foreignObject"