Sanitizes and cleans HTML content by removing unwanted elements, attributes, and whitespace. Provides fine-grained control over each cleaning operation through configurable options.Documentation Index
Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Examples
Arguments
The HTML content to sanitize
Remove all
<script> elements. Defaults to True.Remove all
<style> elements. Defaults to True.Remove all
<svg> elements. Defaults to True.Remove HTML comments. Defaults to True.
Remove attributes longer than max_attribute_length. Defaults to True.
Maximum length for attributes before removal. Defaults to 500.
List of attribute names to always preserve. Defaults to [“class”, “src”].
Remove empty tags (except preserved ones). Defaults to True.
List of tag names to preserve even when empty. Defaults to [“img”].
Remove extra whitespace between tags and empty lines. Defaults to True.