blob: 601e181c44ef960d03044b52bb93ae3f80caa5de [file] [log] [blame]
Georg Brandlc76ffca2008-05-17 21:54:03 +00001:mod:`html.entities` --- Definitions of HTML general entities
2=============================================================
3
4.. module:: htmlentitydefs
5 :synopsis: Old name for the html.entities module.
6
7.. module:: html.entities
8 :synopsis: Definitions of HTML general entities.
9.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
10
11.. note::
12 The :mod:`htmlentitydefs` module has been renamed to :mod:`html.entities` in
13 Python 3.0. It is importable under both names in Python 2.6 and the rest of
14 the 2.x series.
15
16
17This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
18and ``entitydefs``. ``entitydefs`` is used by the :mod:`htmllib` module to
19provide the :attr:`entitydefs` member of the :class:`HTMLParser` class. The
20definition provided here contains all the entities defined by XHTML 1.0 that
21can be handled using simple textual substitution in the Latin-1 character set
22(ISO-8859-1).
23
24
25.. data:: entitydefs
26
27 A dictionary mapping XHTML 1.0 entity definitions to their replacement text in
28 ISO Latin-1.
29
30
31.. data:: name2codepoint
32
33 A dictionary that maps HTML entity names to the Unicode codepoints.
34
35 .. versionadded:: 2.3
36
37
38.. data:: codepoint2name
39
40 A dictionary that maps Unicode codepoints to HTML entity names.
41
42 .. versionadded:: 2.3