sanitizer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBlockList = []string{
	"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
	"data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",
	"feedburner.google.com",
}

Functions

This section is empty.

Types

type BlockList

type BlockList struct {
	// contains filtered or unexported fields
}

BlockList is a block-list structure

func NewBlockList

func NewBlockList(location string, init []string) (*BlockList, error)

NewBlockList create new block-list form a text file

func (*BlockList) Contains

func (bl *BlockList) Contains(value string) bool

Contains check if the provided value is into the block-list

func (*BlockList) Location

func (bl *BlockList) Location() string

Location of the block-list

func (*BlockList) Size

func (bl *BlockList) Size() uint32

Size of the block-list

type Sanitizer

type Sanitizer struct {
	// contains filtered or unexported fields
}

Sanitizer is a HTML sanitizer

func NewSanitizer

func NewSanitizer(blockList *BlockList) *Sanitizer

NewSanitizer create new HTML sanitizer

func (*Sanitizer) Sanitize

func (s *Sanitizer) Sanitize(content string) string

Sanitize HTML content

Jump to

Keyboard shortcuts

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