parser

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeywords

func GetKeywords(doc *goquery.Document) []string

GetKeywords gets the keywords meta tag from the HTML DOM

func GetTitle

func GetTitle(doc *goquery.Document, defaultTitle string) string

GetTitle returns the head.title or defaultTitle if not found.

func IsLocalFile

func IsLocalFile(src string) bool

IsLocalFile returns true if the given img src refers to a local file.

func ParseHTML

func ParseHTML(fileName string) (*goquery.Document, error)

ParseHTML parses the given HTML file and returns on success a goquery Document.

func RenderDocument

func RenderDocument(doc *goquery.Document) string

RenderDocument renders a goquery.Document as string.

func RenderNode

func RenderNode(n *html.Node) string

RenderNode renders the html.Node as a string

func SplitList

func SplitList(text string) []string

SplitList splits a "," separated attribute list into an array

Types

type GoquerySelections

type GoquerySelections []*goquery.Selection

GoquerySelections is a list of DOM tree selections.

type ImageList

type ImageList map[string]GoquerySelections

ImageList is a list of images mapping from a local file name to multiple goquery.Selections.

func FindImages

func FindImages(doc *goquery.Document) ImageList

FindImages returns an ImageList of all local images within a DOM tree. The ImageList maps the "src" attribute to a list of goquery.Selections which can be used for modifying the DOM tree after uploading the image.

Jump to

Keyboard shortcuts

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