xoutil.html – Helpers for manipulating HTML.

This module defines utilities to manipulate HTML.

This module backports several utilities from Python 3.2.

xoutil.html.escape(s, quote=True)[source]

Replace special characters “&”, “<” and “>” to HTML-safe sequences

If the optional flag quote is true (the default), the quotation mark characters, both double quote (”) and single quote (‘) characters are also translated.