clean_html

package
v0.0.0-...-584605b Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractClass

func ExtractClass(n *html.Node) string

return class attribute values of a html element

func ExtractIFrames

func ExtractIFrames(startTag string, n *html.Node, uri string) string

func ExtractImages

func ExtractImages(startTag string, n *html.Node, uri string, imageList []models.Upload) (string, []models.Upload, string, int)

func GenerateImagePath

func GenerateImagePath(href string, uri string) (string, models.Upload)

Types

type Config

type Config struct {
	LineBreakers   []string
	IgnoreElements []string
	IgnoreStrings  []string
	IgnoreTitles   []string
	IgnoreClasses  []string
}

type HtmlCleaner

type HtmlCleaner struct {
	Config Config
}

func (HtmlCleaner) CleanHTML

func (c HtmlCleaner) CleanHTML(uri string, body *html.Node) (string, []models.Entity, []models.Upload, string)

Jump to

Keyboard shortcuts

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