Georg Brandl | 9087b7f | 2008-05-18 07:53:01 +0000 | [diff] [blame] | 1 | :mod:`html.entities` --- Definitions of HTML general entities |
| 2 | ============================================================= |
| 3 | |
| 4 | .. module:: html.entities |
| 5 | :synopsis: Definitions of HTML general entities. |
| 6 | .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org> |
| 7 | |
Raymond Hettinger | a199368 | 2011-01-27 01:20:32 +0000 | [diff] [blame] | 8 | **Source code:** :source:`Lib/html/entities.py` |
| 9 | |
| 10 | -------------- |
Georg Brandl | 9087b7f | 2008-05-18 07:53:01 +0000 | [diff] [blame] | 11 | |
| 12 | This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``, |
Georg Brandl | 877b10a | 2008-06-01 21:25:55 +0000 | [diff] [blame] | 13 | and ``entitydefs``. ``entitydefs`` is used to provide the :attr:`entitydefs` |
| 14 | member of the :class:`html.parser.HTMLParser` class. The definition provided |
| 15 | here contains all the entities defined by XHTML 1.0 that can be handled using |
| 16 | simple textual substitution in the Latin-1 character set (ISO-8859-1). |
Georg Brandl | 9087b7f | 2008-05-18 07:53:01 +0000 | [diff] [blame] | 17 | |
| 18 | |
| 19 | .. data:: entitydefs |
| 20 | |
| 21 | A dictionary mapping XHTML 1.0 entity definitions to their replacement text in |
| 22 | ISO Latin-1. |
| 23 | |
| 24 | |
| 25 | .. data:: name2codepoint |
| 26 | |
| 27 | A dictionary that maps HTML entity names to the Unicode codepoints. |
| 28 | |
| 29 | |
| 30 | .. data:: codepoint2name |
| 31 | |
| 32 | A dictionary that maps Unicode codepoints to HTML entity names. |