fosterParenting bool
// quirks is whether the parser is operating in "quirks mode."
quirks bool
+ // fragment is whether the parser is parsing an HTML fragment.
+ fragment bool
// context is the context element when parsing an HTML fragment
// (section 12.4).
context *Node
}
case EndTagToken:
if p.tok.DataAtom == a.Html {
- p.im = afterAfterBodyIM
+ if !p.fragment {
+ p.im = afterAfterBodyIM
+ }
return true
}
case CommentToken:
Type: DocumentNode,
},
scripting: true,
+ fragment: true,
context: context,
}