htmlutil

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNonce

func AddNonce(el *Element, len uint8) (string, error)

func AddSha256HashExternal

func AddSha256HashExternal(el *Element, externalSha256Hash string) (string, error)

func AddSha256HashInline

func AddSha256HashInline(el *Element) (string, error)

func RenderElement

func RenderElement(el *Element) (template.HTML, error)

func RenderElementToBuilder

func RenderElementToBuilder(el *Element, htmlBuilder *strings.Builder) error

func RenderModuleScriptToBuilder

func RenderModuleScriptToBuilder(src string, htmlBuilder *strings.Builder) error

Types

type Element

type Element struct {
	Tag                 string            `json:"tag,omitempty"`
	Attributes          map[string]string `json:"attributes,omitempty"`
	AttributesKnownSafe map[string]string `json:"attributesKnownSafe,omitempty"`
	BooleanAttributes   []string          `json:"booleanAttributes,omitempty"`
	TextContent         string            `json:"textContent,omitempty"`
	DangerousInnerHTML  string            `json:"dangerousInnerHTML,omitempty"`
	SelfClosing         bool              `json:"-"`
}

func EscapeIntoTrusted

func EscapeIntoTrusted(el *Element) Element

Jump to

Keyboard shortcuts

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