htmlsafe

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package htmlsafe provides small helpers for producing safe HTML output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Escape

func Escape(s string) string

Escape escapes untrusted text for safe inclusion into HTML contexts.

func RenderTemplate

func RenderTemplate(name string, tmpl string, data any) (string, error)

RenderTemplate renders an html/template to a string.

func SanitizeHTMLByContract

func SanitizeHTMLByContract(content string) string

SanitizeHTMLByContract sanitizes HTML that is meant to be rendered as HTML by clients (e.g. Mastodon fields).

Types

This section is empty.

Jump to

Keyboard shortcuts

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