Documentation
¶
Index ¶
- Variables
- func CheckMediumSignals(n *html.Node) int
- func CleanRedditHTML(content string) string
- func ExtractImageFromHTML(content string) (string, string, error)
- 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)
- func ToPlainText(s string) string
- type Favicon
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckMediumSignals ¶
checkMediumSignals walks the HTML tree and counts Medium-specific markers.
func CleanRedditHTML ¶
CleanRedditHTML will remove the janky table format that some reddit posts are contained within.
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 ¶
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.
func ToPlainText ¶
ToPlainText converts a HTML encoded string to plain text.