You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gosuv/vendor/github.com/kennygrant/sanitize
codeskyblue d9eaa12b21
update deps
8 years ago
..
.gitignore update deps 8 years ago
.travis.yml update deps 8 years ago
License-BSD.txt update deps 8 years ago
README.md update deps 8 years ago
sanitize.go update deps 8 years ago

README.md

sanitize

Package sanitize provides functions to sanitize html and paths with go (golang).

FUNCTIONS

sanitize.Accents(s string) string

Accents replaces a set of accented characters with ascii equivalents.

sanitize.BaseName(s string) string

BaseName makes a string safe to use in a file name, producing a sanitized basename replacing . or / with -. Unlike Name no attempt is made to normalise text as a path.

sanitize.HTML(s string) string

Strip html tags with a very simple parser, replace common entities, and escape < and > in the result. The result is intended to be used as plain text.

sanitize.HTMLAllowing(s string, args...[]string) (string, error)

Parse html and allow certain tags and attributes from the lists optionally specified by args - args[0] is a list of allowed tags, args[1] is a list of allowed attributes. If either is missing default sets are used.

sanitize.Name(s string) string

Name makes a string safe to use in a file name by first finding the path basename, then replacing non-ascii characters.

sanitize.Path(s string) string

Path makes a string safe to use as an url path.