Documentation ¶
Overview ¶
Package xhtml makes x/net/html easier
Index ¶
- Variables
- func AdoptChildren(dst, src *html.Node)
- func AppendText(n *html.Node, text string)
- func Attr(n *html.Node, name string) string
- func Children(n *html.Node) []*html.Node
- func Clone(n *html.Node) *html.Node
- func Closest(n *html.Node, match func(*html.Node) bool) *html.Node
- func DeleteAttr(n *html.Node, key string)
- func Find(n *html.Node, match func(*html.Node) bool) *html.Node
- func FindAll(root *html.Node, match func(*html.Node) bool) []*html.Node
- func InnerHTML(n *html.Node) string
- func InnerHTMLBlocks(n *html.Node) string
- func InnerText(n *html.Node) string
- func LastChildOrNew(p *html.Node, tag string, attrs ...string) *html.Node
- func Map[T any](tbl TableNodes, f func(*html.Node) T) [][]T
- func New(tag string, attrs ...string) *html.Node
- func OuterHTML(n *html.Node) string
- func RemoveAll(nodes []*html.Node)
- func ReplaceWith(old, new *html.Node)
- func SetAttr(n *html.Node, key, value string)
- func SetInnerHTML(n *html.Node, s string) error
- func Tables(root *html.Node, f func(tbl *html.Node, rows TableNodes))
- func ToBuffer(n *html.Node) *bytes.Buffer
- func UnnestChildren(n *html.Node)
- func VisitAll(n *html.Node, callback func(*html.Node))
- func WithAtom(a atom.Atom) func(n *html.Node) bool
- type TableNodes
Constants ¶
This section is empty.
Variables ¶
View Source
var WithBody = WithAtom(atom.Body)
Functions ¶
func AdoptChildren ¶
func AppendText ¶
func DeleteAttr ¶
func InnerHTMLBlocks ¶
InnerHTMLBlocks is the same as InnerHTML, but it separates top level nodes with a line break.
func RemoveAll ¶
RemoveAll orphans the nodes it is passed. It ignores a node if the node is nil or already an orphan.
func ReplaceWith ¶
func UnnestChildren ¶
UnnestChildren has all of the children of node adopted by its parent, and then it removes the node.
Types ¶
type TableNodes ¶
func (TableNodes) Label ¶
func (rows TableNodes) Label() string
Click to show internal directories.
Click to hide internal directories.