xhtml

package
v0.0.0-...-c8f585d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdoptChildren

func AdoptChildren(dst, src *html.Node)

func AppendText

func AppendText(n *html.Node, text string)

func Attr

func Attr(n *html.Node, name string) string

func Children

func Children(n *html.Node) iter.Seq[*html.Node]

Children returns a seq of the immediate children of n.

func Clone

func Clone(n *html.Node) *html.Node

Clone n and all of its children.

func DeleteAttr

func DeleteAttr(n *html.Node, key string)

func LastChildOrNew

func LastChildOrNew(p *html.Node, tag string, attrs ...string) *html.Node

func Map

func Map[T any](tbl TableNodes, f func(*html.Node) T) [][]T

func New

func New(tag string, attrs ...string) *html.Node

func RemoveAll

func RemoveAll(nodes []*html.Node)

RemoveAll orphans the nodes it is passed. It ignores a node if the node is nil or already an orphan.

func ReplaceWith

func ReplaceWith(old, new *html.Node)

func SetAttr

func SetAttr(n *html.Node, key, value string)

func SetInnerHTML

func SetInnerHTML(n *html.Node, s string) error

func Tables

func Tables(root *html.Node) iter.Seq2[*html.Node, TableNodes]

func UnnestChildren

func UnnestChildren(n *html.Node)

UnnestChildren has all of the children of node adopted by its parent, and then it removes the node.

Types

type TableNodes

type TableNodes [][]*html.Node

func (TableNodes) At

func (rows TableNodes) At(row, col int) *html.Node

func (TableNodes) Label

func (rows TableNodes) Label() string

func (TableNodes) Value

func (rows TableNodes) Value(name string) *html.Node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL