blob: 067e1b1e5adb3e29887a21bd7ffc7848db007e71 [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.
Terry Jan Reedyfa089b92016-06-11 15:02:54 -04006
Georg Brandl9087b7f2008-05-18 07:53:01 +00007.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
8
Raymond Hettingera1993682011-01-27 01:20:32 +00009**Source code:** :source:`Lib/html/entities.py`
10
11--------------
Georg Brandl9087b7f2008-05-18 07:53:01 +000012
Ezio Melottidc44f552012-06-24 04:37:41 +020013This module defines four dictionaries, :data:`html5`,
14:data:`name2codepoint`, :data:`codepoint2name`, and :data:`entitydefs`.
Georg Brandl9087b7f2008-05-18 07:53:01 +000015
16
Ezio Melottidc44f552012-06-24 04:37:41 +020017.. data:: html5
18
19 A dictionary that maps HTML5 named character references [#]_ to the
20 equivalent Unicode character(s), e.g. ``html5['gt;'] == '>'``.
21 Note that the trailing semicolon is included in the name (e.g. ``'gt;'``),
22 however some of the names are accepted by the standard even without the
23 semicolon: in this case the name is present with and without the ``';'``.
Ezio Melotti4a9ee262013-11-19 20:28:45 +020024 See also :func:`html.unescape`.
Ezio Melottidc44f552012-06-24 04:37:41 +020025
26 .. versionadded:: 3.3
27
28
Georg Brandl9087b7f2008-05-18 07:53:01 +000029.. data:: entitydefs
30
31 A dictionary mapping XHTML 1.0 entity definitions to their replacement text in
32 ISO Latin-1.
33
34
35.. data:: name2codepoint
36
Georg Brandl3be472b2015-01-14 08:26:30 +010037 A dictionary that maps HTML entity names to the Unicode code points.
Georg Brandl9087b7f2008-05-18 07:53:01 +000038
39
40.. data:: codepoint2name
41
Georg Brandl3be472b2015-01-14 08:26:30 +010042 A dictionary that maps Unicode code points to HTML entity names.
Ezio Melottidc44f552012-06-24 04:37:41 +020043
44
45.. rubric:: Footnotes
46
Serhiy Storchaka6dff0202016-05-07 10:49:07 +030047.. [#] See https://www.w3.org/TR/html5/syntax.html#named-character-references