Skip to main content

Module html

Module html 

Source
Expand description

HTML and inline-script escaping helpers.

These helpers are intentionally small and dependency-free. They are meant for server-side placeholder injection into already generated HTML, not for sanitizing untrusted rich HTML.

Functionsยง

escape_html
Escapes text for HTML text or attribute placeholder insertion.
escape_script_json
Escapes a JSON string fragment before embedding it in an inline <script> context.