blob: 09b0abc83793465ef53e14d9e8854914e894734a [file] [log] [blame]
Georg Brandl9087b7f2008-05-18 07:53:01 +00001: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 Hettingera1993682011-01-27 01:20:32 +00008**Source code:** :source:`Lib/html/entities.py`
9
10--------------
Georg Brandl9087b7f2008-05-18 07:53:01 +000011
Ezio Melottidc44f552012-06-24 04:37:41 +020012This module defines four dictionaries, :data:`html5`,
13:data:`name2codepoint`, :data:`codepoint2name`, and :data:`entitydefs`.
Georg Brandl9087b7f2008-05-18 07:53:01 +000014
15
Ezio Melottidc44f552012-06-24 04:37:41 +020016.. 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 Melotti4a9ee262013-11-19 20:28:45 +020023 See also :func:`html.unescape`.
Ezio Melottidc44f552012-06-24 04:37:41 +020024
25 .. versionadded:: 3.3
26
27
Georg Brandl9087b7f2008-05-18 07:53:01 +000028.. 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
36 A dictionary that maps HTML entity names to the Unicode codepoints.
37
38
39.. data:: codepoint2name
40
41 A dictionary that maps Unicode codepoints to HTML entity names.
Ezio Melottidc44f552012-06-24 04:37:41 +020042
43
44.. rubric:: Footnotes
45
Ezio Melottif5005882013-11-25 06:40:12 +020046.. [#] See http://www.w3.org/TR/html5/syntax.html#named-character-references