gocuelang.org/go/pkg/html Index | Files

package html

import "cuelang.org/go/pkg/html"

Index

Functions

func Escape

func Escape(s string) string

Escape escapes special characters like "<" to become "&lt;". It escapes only five such characters: <, >, &, ' and ". UnescapeString(Escape(s)) == s always holds, but the converse isn't always true.

func Unescape

func Unescape(s string) string

Unescape unescapes entities like "&lt;" to become "<". It unescapes a larger range of entities than EscapeString escapes. For example, "&aacute;" unescapes to "á", as does "&#225;" and "&#xE1;". Unescape(EscapeString(s)) == s always holds, but the converse isn't always true.

Source Files

html.go pkg.go

Version
v0.12.0 (latest)
Published
Jan 30, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
8 hours ago

Tools for package owners.