blob: 0063db60cd3302c80cff4cae883cdd82a80144eb [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
7.. versionadded:: 3.2
8
Raymond Hettingera1993682011-01-27 01:20:32 +00009**Source code:** :source:`Lib/html/__init__.py`
10
11--------------
Georg Brandl1f7fffb2010-10-15 15:57:45 +000012
13This module defines utilities to manipulate HTML.
14
15.. function:: escape(s, quote=True)
16
17 Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe
18 sequences. Use this if you need to display text that might contain such
19 characters in HTML. If the optional flag *quote* is true, the characters
20 (``"``) and (``'``) are also translated; this helps for inclusion in an HTML
21 attribute value delimited by quotes, as in ``<a href="...">``.