safehtml

package
v0.3.977 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const InnocuousPropertyName = "zTemplUnsafeCSSPropertyName"

InnocuousPropertyName is an innocuous property generated by a sanitizer when its input is unsafe.

View Source
const InnocuousPropertyValue = "zTemplUnsafeCSSPropertyValue"

InnocuousPropertyValue is an innocuous property generated by a sanitizer when its input is unsafe.

Variables

This section is empty.

Functions

func SanitizeCSS

func SanitizeCSS(property, value string) (string, string)

SanitizeCSS attempts to sanitize CSS properties.

func SanitizeCSSProperty added in v0.2.619

func SanitizeCSSProperty(property string) string

func SanitizeCSSValue added in v0.2.619

func SanitizeCSSValue(property, value string) string

func SanitizeStyleValue added in v0.3.833

func SanitizeStyleValue(s string) string

SanitizeStyleValue escapes s so that it is safe to put between "" to form a CSS <string-token>. See syntax at https://www.w3.org/TR/css-syntax-3/#string-token-diagram.

On top of the escape sequences required in <string-token>, this function also escapes control runes to minimize the risk of these runes triggering browser-specific bugs. Taken from cssEscapeString in safehtml package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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