htmlutil

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAttr

func GetAttr(node *html.Node, key string) (string, bool)

GetAttr returns a node's attribute value by key. Returns false if the attribute does not exist.

func ResolveReferences

func ResolveReferences(input string, base *url.URL) (string, error)

Resolve URLs in the input HTML document located at base. Returns the same document, where all relative hrefs and srcs are replaced with absolute URLs.

func SetAttr

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

SetAttr sets a node's attribute value by key.

func Walk

func Walk(node *html.Node, walkFunc func(node *html.Node) error) error

Walk walks a node by performing a depth-first search.

Types

This section is empty.

Jump to

Keyboard shortcuts

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