| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,13 +9,25 @@ | |||
| 9 | 9 | ||
| 10 | 10 | -------------- | |
| 11 | 11 | ||
| 12 | - This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``, | ||
| 13 | - and ``entitydefs``. ``entitydefs`` is used to provide the :attr:`entitydefs` | ||
| 12 | + This module defines four dictionaries, :data:`html5`, | ||
| 13 | + :data:`name2codepoint`, :data:`codepoint2name`, and :data:`entitydefs`. | ||
| 14 | + :data:`entitydefs` is used to provide the :attr:`entitydefs` | ||
| 14 | 15 | attribute of the :class:`html.parser.HTMLParser` class. The definition provided | |
| 15 | 16 | here contains all the entities defined by XHTML 1.0 that can be handled using | |
| 16 | 17 | simple textual substitution in the Latin-1 character set (ISO-8859-1). | |
| 17 | 18 | ||
| 18 | 19 | ||
| 20 | + .. data:: html5 | ||
| 21 | + | ||
| 22 | + A dictionary that maps HTML5 named character references [#]_ to the | ||
| 23 | + equivalent Unicode character(s), e.g. ``html5['gt;'] == '>'``. | ||
| 24 | + Note that the trailing semicolon is included in the name (e.g. ``'gt;'``), | ||
| 25 | + however some of the names are accepted by the standard even without the | ||
| 26 | + semicolon: in this case the name is present with and without the ``';'``. | ||
| 27 | + | ||
| 28 | + .. versionadded:: 3.3 | ||
| 29 | + | ||
| 30 | + | ||
| 19 | 31 | .. data:: entitydefs | |
| 20 | 32 | ||
| 21 | 33 | A dictionary mapping XHTML 1.0 entity definitions to their replacement text in | |
@@ -30,3 +42,8 @@ simple textual substitution in the Latin-1 character set (ISO-8859-1). | |||
| 30 | 42 | .. data:: codepoint2name | |
| 31 | 43 | ||
| 32 | 44 | A dictionary that maps Unicode codepoints to HTML entity names. | |
| 45 | + | ||
| 46 | + | ||
| 47 | + .. rubric:: Footnotes | ||
| 48 | + | ||
| 49 | + .. [#] See http://www.w3.org/TR/html5/named-character-references.html | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments