blob: b8b4aa8f9128c6a5e3f0504d71bf70c307e0cde4 [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
12This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
Georg Brandl877b10a2008-06-01 21:25:55 +000013and ``entitydefs``. ``entitydefs`` is used to provide the :attr:`entitydefs`
Senthil Kumarana6bac952011-07-04 11:28:30 -070014attribute of the :class:`html.parser.HTMLParser` class. The definition provided
Georg Brandl877b10a2008-06-01 21:25:55 +000015here contains all the entities defined by XHTML 1.0 that can be handled using
16simple textual substitution in the Latin-1 character set (ISO-8859-1).
Georg Brandl9087b7f2008-05-18 07:53:01 +000017
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.