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
Click to show internal directories.
Click to hide internal directories.