Documentation
¶
Index ¶
- Variables
- func Children(n *html.Node) (ns []*html.Node)
- func Create(tag string) *html.Node
- func DelAttr(n *html.Node, name string)
- func Drop(n *html.Node) *html.Node
- func FindAllFunc(n *html.Node, f func(*html.Node) bool) (nodes []*html.Node)
- func FindId(n *html.Node, id string) *html.Node
- func FindOne(n *html.Node, a atom.Atom) *html.Node
- func FindOneFunc(n *html.Node, f func(*html.Node) bool) *html.Node
- func FindTags(n *html.Node, f func(*html.Node), atoms ...atom.Atom)
- func GetAttr(n *html.Node, name string) string
- func GetText(n *html.Node) string
- func GetValue(n *html.Node) string
- func Lift(n *html.Node)
- func ParseClean(r io.Reader) (*html.Node, error)
- func Replace(original, repl *html.Node)
- func SetAttr(n *html.Node, name, val string)
- func Walk(n *html.Node, before, after func(*html.Node))
- type AtomSet
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Codes = NewAtomSetFromString("style script link") Blocks = NewAtomSetFromString("address article aside audio blockquote canvas dd div dl fieldset figcaption figure figcaption footer form h1 h2 h3 h4 h5 h6 header hgroup hr noscript ol output p pre section table tfoot ul video") Containers = NewAtomSetFromString("article aside div footer header hgroup section") Headers = NewAtomSetFromString("h1 h2 h3 h4 h5 h6 h7") Voids = NewAtomSetFromString("area base br col embed hr img input keygen link meta param source track wbr") )
View Source
var BodyContext *html.Node
BodyContext can be used as the context when parsing fragments.
Functions ¶
func ParseClean ¶
Clean and parse the HTML, so that: 0. Encoding converted to UTF8 if not already. 1. Comment and DOCTYPE removed. 2. Code blocks (script, style, link) removed.
Types ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.