]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] 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:54 +0000 (08:43 +0200)
committerGitHub <noreply@github.com>
Fri, 9 May 2025 06:43:54 +0000 (09:43 +0300)
commit3e5544109094d444f6a72c1cb5c9e8c4091e1362
tree9bee667c34398dbd957f4348e5ad7ba83e982343
parentdf858161d5aa62dde2f16d6435595ae4a12079a5
[3.13] gh-69426: HTMLParser: only unescape properly terminated character entities in attribute values (GH-95215) (GH-133586)

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]