blob: 0aabbadc58a6b4d23b86c123fd513fa93a93326d [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 ``';'``.
23
24 .. versionadded:: 3.3
25
26
Georg Brandl9087b7f2008-05-18 07:53:01 +000027.. data:: entitydefs
28
29 A dictionary mapping XHTML 1.0 entity definitions to their replacement text in
30 ISO Latin-1.
31
32
33.. data:: name2codepoint
34
35 A dictionary that maps HTML entity names to the Unicode codepoints.
36
37
38.. data:: codepoint2name
39
40 A dictionary that maps Unicode codepoints to HTML entity names.
Ezio Melottidc44f552012-06-24 04:37:41 +020041
42
43.. rubric:: Footnotes
44
Ezio Melottif5005882013-11-25 06:40:12 +020045.. [#] See http://www.w3.org/TR/html5/syntax.html#named-character-references