]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-69426: HTMLParser: only unescape properly terminated character entities...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 9 May 2025 06:43:21 +0000 (08:43 +0200)
committerGitHub <noreply@github.com>
Fri, 9 May 2025 06:43:21 +0000 (09:43 +0300)
commit3937c78e36648193ec0e91ca1d10b39680d7c657
treef0d1325eb6840049df970ca801db418dc0679be0
parent8e86f9c3ccbe8955ea5b28b07bb3d37197eef841
[3.14] gh-69426: HTMLParser: only unescape properly terminated character entities in attribute values (GH-95215) (GH-133704)

According to the HTML5 spec, named character references in attribute values
should only be processed if they are not followed by an ASCII alphanumeric,
or an equals sign.
(cherry picked from commit 77b14a6d58e527f915966446eb0866652a46feb5)

https: //html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state

Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com>
Lib/html/parser.py
Lib/test/test_htmlparser.py
Misc/NEWS.d/next/Library/2022-07-24-20-56-32.gh-issue-69426.unccw7.rst [new file with mode: 0644]