sanitize

package
v0.0.0-...-be087da Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2015 License: MIT Imports: 5 Imported by: 0

README

sanitize

Package sanitize provides functions for sanitizing text in golang strings.

FUNCTIONS


func Accents(text string) string

Replace a set of accented characters with ascii equivalents.

func HTML(s string) (output string)

Strip html tags, replace common entities, and escape < and > in the result. Later could consider taking options and allowing certain tags, attributes etc

func Name(text string) string

Makes a string safe to use in a file name (e.g. for saving file atttachments)

func Path(text string) string

Makes a string safe to use as an url path, cleaned of .. and unsuitable characters

Documentation

Overview

Package sanitize provides functions for sanitizing text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accents

func Accents(text string) string

Replace a set of accented characters with ascii equivalents.

func HTML

func HTML(s string) (output string)

Strip html tags, replace common entities, and escape <>&;'" in the result. Note the returned text may contain entities as it is escaped by HTMLEscapeString, and most entities are not translated.

func Name

func Name(text string) string

Makes a string safe to use in a file name (e.g. for saving file atttachments)

func Path

func Path(text string) string

Makes a string safe to use as an url path, cleaned of .. and unsuitable characters

Types

This section is empty.

Jump to

Keyboard shortcuts

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