Documentation
¶
Index ¶
- func FindAllHTMLNodes(n *html.Node, tag string) []*html.Node
- func FindHTMLNode(n *html.Node, tag string) *html.Node
- func FindMainImage(page []byte, rawURL string) (string, error)
- func IsHTML(s string) bool
- func IsHTMLElement(str, tag string) bool
- func SanitizeHTMLString(rawStr string) (string, error)
- type Favicon
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAllHTMLNodes ¶
FindAllHTMLNodes returns all nodes matching the tag within n.
func FindHTMLNode ¶
FindHTMLNode does a depth-first search for the first node matching the tag.
func FindMainImage ¶
FindMainImage tries to find a "main" image for the page, using the readability parser.
func IsHTMLElement ¶
IsHTMLElement returns a boolean indicating whether the given string is the given HTML element.
func SanitizeHTMLString ¶ added in v0.83.0
SanitizeHTMLString will parse and re-render the given string containing HTML. In doing so, the HTML is hopefully sanitized and reformatted to be well-formed HTML.
Types ¶
Click to show internal directories.
Click to hide internal directories.