htmlpolicy

command
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Command htmlpolicy applies an HTML sanitization policy to HTML content.

Usage:

htmlpolicy [flags] <policy-arg>... < input.html > output.html

Each argument is either a path to a policy file or inline policy text. Arguments that refer to existing regular files are included (with include directives resolving relative to the file's directory). Other arguments (inline text, or paths that are not regular files) are appended as inline policy lines. Multiple arguments are concatenated in order.

HTML is read from stdin and sanitized output is written to stdout.

Flags:

-fragment          Parse input as an HTML fragment instead of a full document
-detect-charset    Detect and convert input charset to UTF-8
-content-type      Content-Type header for charset detection (only used with -detect-charset)
-prefix            Override the prefix for comment-out and defang-attr actions
-verbose           Log each sanitization action to stderr

Jump to

Keyboard shortcuts

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