Georg Brandl | 1f7fffb | 2010-10-15 15:57:45 +0000 | [diff] [blame] | 1 | :mod:`html` --- HyperText Markup Language support |
| 2 | ================================================= |
| 3 | |
| 4 | .. module:: html |
| 5 | :synopsis: Helpers for manipulating HTML. |
| 6 | |
| 7 | .. versionadded:: 3.2 |
| 8 | |
| 9 | |
| 10 | This module defines utilities to manipulate HTML. |
| 11 | |
| 12 | .. function:: escape(s, quote=True) |
| 13 | |
| 14 | Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe |
| 15 | sequences. Use this if you need to display text that might contain such |
| 16 | characters in HTML. If the optional flag *quote* is true, the characters |
| 17 | (``"``) and (``'``) are also translated; this helps for inclusion in an HTML |
| 18 | attribute value delimited by quotes, as in ``<a href="...">``. |