Documentation
¶
Overview ¶
Package htmlentity is the HTML vocabulary an xmlro.Reader needs to tokenize HTML-flavoured XML: the named character references of HTML 4 and the elements that end with their start tag. It is a separate package so that a reader of Office parts, which needs neither, links neither table.
r := xmlro.NewReader(src, xmlro.Options{
Entities: htmlentity.Lookup,
AutoClose: htmlentity.AutoClose,
Lenient: true,
})
is the reader encoding/xml builds from Strict false, Entity = xml.HTMLEntity and AutoClose = xml.HTMLAutoClose, and a document reads the same through both.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoClose ¶
AutoClose reports whether name is an HTML element that ends with its start tag: br, img, hr and the rest of encoding/xml.HTMLAutoClose. The comparison ignores ASCII case and a namespace prefix, as encoding/xml's does, so xhtml:br inside an SVG foreignObject is one too. A colon that is the first or the last byte is part of the name, not a prefix, as encoding/xml also has it. It is an xmlro.Options.AutoClose.
Types ¶
This section is empty.