| 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 |  | 
| Ezio Melotti | dc44f55 | 2012-06-24 04:37:41 +0200 | [diff] [blame] | 12 | This module defines four dictionaries, :data:`html5`, | 
 | 13 | :data:`name2codepoint`, :data:`codepoint2name`, and :data:`entitydefs`. | 
| Georg Brandl | 9087b7f | 2008-05-18 07:53:01 +0000 | [diff] [blame] | 14 |  | 
 | 15 |  | 
| Ezio Melotti | dc44f55 | 2012-06-24 04:37:41 +0200 | [diff] [blame] | 16 | .. data:: html5 | 
 | 17 |  | 
 | 18 |    A dictionary that maps HTML5 named character references [#]_ to the | 
 | 19 |    equivalent Unicode character(s), e.g. ``html5['gt;'] == '>'``. | 
 | 20 |    Note that the trailing semicolon is included in the name (e.g. ``'gt;'``), | 
 | 21 |    however some of the names are accepted by the standard even without the | 
 | 22 |    semicolon: in this case the name is present with and without the ``';'``. | 
| Ezio Melotti | 4a9ee26 | 2013-11-19 20:28:45 +0200 | [diff] [blame] | 23 |    See also :func:`html.unescape`. | 
| Ezio Melotti | dc44f55 | 2012-06-24 04:37:41 +0200 | [diff] [blame] | 24 |  | 
 | 25 |    .. versionadded:: 3.3 | 
 | 26 |  | 
 | 27 |  | 
| Georg Brandl | 9087b7f | 2008-05-18 07:53:01 +0000 | [diff] [blame] | 28 | .. data:: entitydefs | 
 | 29 |  | 
 | 30 |    A dictionary mapping XHTML 1.0 entity definitions to their replacement text in | 
 | 31 |    ISO Latin-1. | 
 | 32 |  | 
 | 33 |  | 
 | 34 | .. data:: name2codepoint | 
 | 35 |  | 
| Serhiy Storchaka | d3faf43 | 2015-01-18 11:28:37 +0200 | [diff] [blame] | 36 |    A dictionary that maps HTML entity names to the Unicode code points. | 
| Georg Brandl | 9087b7f | 2008-05-18 07:53:01 +0000 | [diff] [blame] | 37 |  | 
 | 38 |  | 
 | 39 | .. data:: codepoint2name | 
 | 40 |  | 
| Serhiy Storchaka | d3faf43 | 2015-01-18 11:28:37 +0200 | [diff] [blame] | 41 |    A dictionary that maps Unicode code points to HTML entity names. | 
| Ezio Melotti | dc44f55 | 2012-06-24 04:37:41 +0200 | [diff] [blame] | 42 |  | 
 | 43 |  | 
 | 44 | .. rubric:: Footnotes | 
 | 45 |  | 
| Ezio Melotti | f500588 | 2013-11-25 06:40:12 +0200 | [diff] [blame] | 46 | .. [#] See http://www.w3.org/TR/html5/syntax.html#named-character-references |