diff options
author | Fred Drake <fdrake@acm.org> | 2008-05-20 06:08:38 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2008-05-20 06:08:38 (GMT) |
commit | d995e1150cab57ed7c885d4b7dd943495022936b (patch) | |
tree | 5daaf7592952fd99af8699b93c1d87d0084a9c1d /Doc/library/htmllib.rst | |
parent | 1f60af87f5657800e333090fb9b204f54163254e (diff) | |
download | cpython-d995e1150cab57ed7c885d4b7dd943495022936b.zip cpython-d995e1150cab57ed7c885d4b7dd943495022936b.tar.gz cpython-d995e1150cab57ed7c885d4b7dd943495022936b.tar.bz2 |
revert creation of the html.entities and html.parser modules
(http://bugs.python.org/issue2882)
Diffstat (limited to 'Doc/library/htmllib.rst')
-rw-r--r-- | Doc/library/htmllib.rst | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/Doc/library/htmllib.rst b/Doc/library/htmllib.rst index 953a4e4..16c1b35 100644 --- a/Doc/library/htmllib.rst +++ b/Doc/library/htmllib.rst @@ -77,12 +77,12 @@ The module defines a parser class and an exception: Interface definition for transforming an abstract flow of formatting events into specific output events on writer objects. - Module :mod:`html.parser` + Module :mod:`HTMLParser` Alternate HTML parser that offers a slightly lower-level view of the input, but is designed to work with XHTML, and does not implement some of the SGML syntax not used in "HTML as deployed" and which isn't legal for XHTML. - Module :mod:`html.entities` + Module :mod:`htmlentitydefs` Definition of replacement text for XHTML 1.0 entities. Module :mod:`sgmllib` @@ -147,3 +147,44 @@ additional methods and instance variables for use within tag methods. call to :meth:`save_bgn`. If the :attr:`nofill` flag is false, whitespace is collapsed to single spaces. A call to this method without a preceding call to :meth:`save_bgn` will raise a :exc:`TypeError` exception. + + +:mod:`htmlentitydefs` --- Definitions of HTML general entities +============================================================== + +.. module:: htmlentitydefs + :synopsis: Definitions of HTML general entities. +.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org> + +.. note:: + The :mod:`htmlentitydefs` module has been renamed to :mod:`html.entities` in + Python 3.0. + + +This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``, +and ``entitydefs``. ``entitydefs`` is used by the :mod:`htmllib` module to +provide the :attr:`entitydefs` member of the :class:`HTMLParser` class. The +definition provided here contains all the entities defined by XHTML 1.0 that +can be handled using simple textual substitution in the Latin-1 character set +(ISO-8859-1). + + +.. data:: entitydefs + + A dictionary mapping XHTML 1.0 entity definitions to their replacement text in + ISO Latin-1. + + +.. data:: name2codepoint + + A dictionary that maps HTML entity names to the Unicode codepoints. + + .. versionadded:: 2.3 + + +.. data:: codepoint2name + + A dictionary that maps Unicode codepoints to HTML entity names. + + .. versionadded:: 2.3 + |