Documentation
¶
Overview ¶
Package sanitize supplies immutable HTML fragment allowlists backed by bluemonday. Output is for HTML body content, not scripts, CSS, URLs or attributes.
Index ¶
Constants ¶
View Source
const MaxInputBytes = 1 << 20
View Source
const MaxOutputBytes = 4 << 20
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
Config configures allowed HTML tags and byte budgets.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns default allowed HTML tags and input and output budgets.
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy never exposes the mutable third-party builder. It is safe for concurrent calls after construction. No CSS, event handlers, data attributes, forms, embedded documents, SVG/MathML, data URLs or script-capable tags are admitted.
Click to show internal directories.
Click to hide internal directories.