gh-82927: Update files related to HTML entities. by ezio-melotti · Pull Request #92504 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
4 changes: 2 additions & 2 deletions Doc/library/html.entities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ This module defines four dictionaries, :data:`html5`,

.. data:: name2codepoint

A dictionary that maps HTML entity names to the Unicode code points.
A dictionary that maps HTML4 entity names to the Unicode code points.


.. data:: codepoint2name

A dictionary that maps Unicode code points to HTML entity names.
A dictionary that maps Unicode code points to HTML4 entity names.


.. rubric:: Footnotes
Expand Down
9 changes: 6 additions & 3 deletions Lib/html/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
__all__ = ['html5', 'name2codepoint', 'codepoint2name', 'entitydefs']


# maps the HTML entity name to the Unicode code point
# from https://html.spec.whatwg.org/multipage/named-characters.html
# maps HTML4 entity name to the Unicode code point
name2codepoint = {
'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
Expand Down Expand Up @@ -261,7 +260,11 @@
}


# maps the HTML5 named character references to the equivalent Unicode character(s)
# HTML5 named character references
# Generated by 'Tools/scripts/parse_html5_entities.py'
# from https://html.spec.whatwg.org/entities.json and
# https://html.spec.whatwg.org/multipage/named-characters.html.
# Map HTML5 named character references to the equivalent Unicode character(s).
html5 = {
'Aacute': '\xc1',
'aacute': '\xe1',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The ``Tools/scripts/parseentities.py`` script used to parse HTML4 entities
has been removed.
27 changes: 18 additions & 9 deletions Tools/scripts/parse_html5_entities.py
64 changes: 0 additions & 64 deletions Tools/scripts/parseentities.py

This file was deleted.