funcs

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(args ...any) any

Computes the Boolean AND of its arguments, returning the first false argument it encounters, or the last argument.

func EscapeCSS added in v0.2.0

func EscapeCSS(data ...any) string

Use `template.CSS` to bypass.

func EscapeComment added in v0.2.0

func EscapeComment(...any) string

func EscapeHTML added in v0.2.0

func EscapeHTML(data ...any) string

Use `template.HTML` to bypass

func EscapeHTMLAttr added in v0.2.0

func EscapeHTMLAttr(data ...any) string

Use `template.HTML` or `template.HTMLAttr` to bypass.

func EscapeJS added in v0.2.0

func EscapeJS(ew io.Writer, data ...any) string

Checks an input string is valid JSON by unmarshalling it. If failed, then returns ";/* ERROR */null;" and writes an actual error to the optional `ew` writer. Also returns `;` if an input string is empty. Use `template.JS` to bypass.

func EscapeJSRegexp added in v0.2.0

func EscapeJSRegexp(data ...any) string

No bypassing.

func EscapeJSStr added in v0.2.0

func EscapeJSStr(data ...any) string

Use `template.JSStr` to bypass.

func EscapeJSTmplLit added in v0.2.0

func EscapeJSTmplLit(data ...any) string

Use `template.JSStr` to bypass.

func EscapeRCData added in v0.2.0

func EscapeRCData(data ...any) string

Use `template.HTML` to bypass.

func EscapeURL added in v0.2.0

func EscapeURL(data ...any) string

Use `template.URL` to bypass.

func EscapeUnquotedHTMLAttr added in v0.2.0

func EscapeUnquotedHTMLAttr(data ...any) string

Use `template.HTMLAttr` to bypass.

func FilterAndEscapeSrcset added in v0.2.0

func FilterAndEscapeSrcset(ew io.Writer, data ...any) string

Use `template.Srcset` to bypass.

func FilterCSS added in v0.2.0

func FilterCSS(data ...any) string

Use `template.CSS` to bypass.

func FilterHTMLTagContent added in v0.2.0

func FilterHTMLTagContent(data ...any) string

Use `template.HTML` to bypass.

func FilterURL added in v0.2.0

func FilterURL(ew io.Writer, data ...any) string

Use `template.URL` to bypass.

func IsNotTrue

func IsNotTrue(x any) bool

func IsTrue

func IsTrue(x any) bool

func MayBe

func MayBe[T any](ew io.Writer, fn func() (T, error)) T

func NormalizeURL added in v0.2.0

func NormalizeURL(data ...any) string

Normalizes an input so it can be embedded in double or single quotes. Use `template.URL` to bypass.

func Or

func Or(args ...any) any

Computes the Boolean OR of its arguments, returning the first true argument it encounters, or the last argument.

func Write

func Write(w io.Writer, v any, ew io.Writer)

Types

This section is empty.

Jump to

Keyboard shortcuts

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