sanitizer

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bluemonday

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

Bluemonday uses the bluemonday package for sanitizing input

func NewBluemondayService

func NewBluemondayService() *Bluemonday

NewBluemondayService creates a new bluemonday sanitizer service

func (*Bluemonday) ContentHTML

func (b *Bluemonday) ContentHTML(input string) string

Sanitizes input to a very restricted HTML subset for content of type HTML

func (*Bluemonday) String

func (b *Bluemonday) String(input string) string

Sanitizes input to a plain string

type Fake

type Fake struct{}

Fake returns the input unchanged

func NewFakeService

func NewFakeService() *Fake

NewFakeService creates a new fake sanitizer service

func (*Fake) ContentHTML

func (f *Fake) ContentHTML(input string) string

Sanitizes input to a very restricted HTML subset for content of type HTML

func (*Fake) String

func (f *Fake) String(input string) string

Sanitizes input to a plain string

type Service

type Service interface {
	// Sanitizes input to a plain string
	String(input string) string

	// Sanitizes input to a very restricted HTML subset for content of type HTML
	ContentHTML(input string) string
}

Service interface

Jump to

Keyboard shortcuts

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