forms

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean added in v0.5.0

func Clean(input string) (cleaned string)

Clean unescapes any HTML entities after using Sanitize on the given input

func CleanRelativePath added in v0.5.0

func CleanRelativePath(path string) (cleaned string)

CleanRelativePath is the same as CleanRequestPath except the cleaned result is a relative file path (has no leading slash character)

func CleanRequestPath added in v0.5.0

func CleanRequestPath(path string) (cleaned string)

CleanRequestPath splits the given path into segments, using StrictClean on each segment while reassembling the cleaned output as an absolute file path (has a leading slash character)

func KebabRelativePath added in v0.5.0

func KebabRelativePath(path string) (kebab string)

KebabRelativePath uses CleanRelativePath on the given string, splits it into path segments and renders each segment in kebab-cased format

ie: KebabRelativePath("lowerCamel/CamelCased/snake_cased") == "lower-camel/camel-cased/snake-cased"

func Sanitize

func Sanitize(input string) (sanitized string)

Sanitize uses bluemonday.UGCPolicy to sanitize the given input

func StrictClean added in v0.5.0

func StrictClean(input string) (cleaned string)

StrictClean is the same as Clean except it uses StrictSanitize on the given input

func StrictCleanKebabValue added in v0.5.0

func StrictCleanKebabValue(name string) (cleaned string)

StrictCleanKebabValue uses StrictClean on the given string, replaces all slashes with dashes and renders the string in kebab-cased format

func StrictSanitize added in v0.5.0

func StrictSanitize(input string) (sanitized string)

StrictSanitize uses bluemonday.StrictPolicy to sanitize the given input

func TrimQueryParams

func TrimQueryParams(path string) (trimmed string)

TrimQueryParams truncates the given string at the first question mark character

Types

This section is empty.

Jump to

Keyboard shortcuts

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