blob: 3ad1c0c5c8361a7453cd10a7bd7a944ce7840fd1 [file] [log] [blame]
Georg Brandl1f7fffb2010-10-15 15:57:45 +00001:mod:`html` --- HyperText Markup Language support
2=================================================
3
4.. module:: html
5 :synopsis: Helpers for manipulating HTML.
6
Raymond Hettingera1993682011-01-27 01:20:32 +00007**Source code:** :source:`Lib/html/__init__.py`
8
9--------------
Georg Brandl1f7fffb2010-10-15 15:57:45 +000010
11This module defines utilities to manipulate HTML.
12
13.. function:: escape(s, quote=True)
14
15 Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe
16 sequences. Use this if you need to display text that might contain such
17 characters in HTML. If the optional flag *quote* is true, the characters
18 (``"``) and (``'``) are also translated; this helps for inclusion in an HTML
19 attribute value delimited by quotes, as in ``<a href="...">``.
Georg Brandl2c580752012-04-11 18:33:17 +020020
21 .. versionadded:: 3.2