mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Add two dictionaries to htmlentitydefs: name2codepoint maps
HTML entity names to Unicode codepoints (as integers). codepoint2name is the reverse mapping. From SF patch #722017.
This commit is contained in:
parent
19a02ba69d
commit
5688b7ac3e
3 changed files with 289 additions and 257 deletions
|
@ -145,15 +145,27 @@ method without a preceding call to \method{save_bgn()} will raise a
|
|||
\modulesynopsis{Definitions of HTML general entities.}
|
||||
\sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org}
|
||||
|
||||
This module defines a single dictionary, \code{entitydefs}, which is
|
||||
This module defines three dictionaries, \code{name2codepoint},
|
||||
\code{codepoint2name}, and \code{entitydefs}. \code{entitydefs} is
|
||||
used by the \refmodule{htmllib} module to provide the
|
||||
\member{entitydefs} member of the \class{HTMLParser} class. The
|
||||
definition provided here contains all the entities defined by HTML 2.0
|
||||
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).
|
||||
|
||||
|
||||
\begin{datadesc}{entitydefs}
|
||||
A dictionary mapping HTML 2.0 entity definitions to their
|
||||
A dictionary mapping XHTML 1.0 entity definitions to their
|
||||
replacement text in ISO Latin-1.
|
||||
|
||||
\end{datadesc}
|
||||
|
||||
\begin{datadesc}{name2codepoint}
|
||||
A dictionary that maps HTML entity names to the Unicode codepoints.
|
||||
\end{datadesc}
|
||||
|
||||
\begin{datadesc}{codepoint2name}
|
||||
A dictionary that maps Unicode codepoints to HTML entity names.
|
||||
\end{datadesc}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue