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 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 InnerHTML(n *html.Node) string
- func InnerHTMLBlocks(n *html.Node) string
- func IsBalanced(s string) bool
- func LastChildOrNew(p *html.Node, tag string, attrs ...string) *html.Node
- 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 Select(n *html.Node, match func(*html.Node) bool) *html.Node
- func SelectAll(n *html.Node, match func(*html.Node) bool) iter.Seq[*html.Node]
- func SelectSlice(n *html.Node, match func(*html.Node) bool) []*html.Node
- func SetAttr(n *html.Node, key, value string)
- func SetInnerHTML(n *html.Node, s string) error
- func TextContent(n *html.Node) string
- func ToBuffer(n *html.Node) *bytes.Buffer
- func UnnestChildren(n *html.Node)
- func WithAtom(a atom.Atom) func(n *html.Node) bool
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 IsBalanced ¶
IsBalanced reports whether every opening tag has a closing pair.
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 SelectSlice ¶
SelectSlice returns a slice of child nodes matched by the selector.
func TextContent ¶
TextContent joins and trims the text node children of n.
func UnnestChildren ¶
UnnestChildren has all of the children of node adopted by its parent, and then it removes the node.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.