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 EscapePlainTextHTML ¶ added in v1.2.53
EscapePlainTextHTML normalizes untrusted plain text for HTML-by-contract fields.
Some Lesser API fields are rendered as HTML by Mastodon-compatible clients even when the source value is user-authored plain text. Unescape first so legacy already-escaped values do not become double-escaped, then escape the normalized text for safe HTML inclusion.
func RenderTemplate ¶
RenderTemplate renders an html/template to a string.
func SanitizeHTMLByContract ¶
SanitizeHTMLByContract sanitizes HTML that is meant to be rendered as HTML by clients (e.g. Mastodon fields).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.