gh-135661: Fix parsing unterminated bogus comments in HTMLParser (GH-137873)

Bogus comments that start with "<![CDATA[" should not include the starting "!"
in its value.
This commit is contained in:
Serhiy Storchaka 2025-08-17 13:37:50 +03:00 committed by GitHub
parent eac37b46d9
commit 7636a66635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 15 deletions

View file

@ -791,7 +791,7 @@ def test_eof_in_cdata(self, content):
self._run_check('<![CDATA[' + content,
[('unknown decl', 'CDATA[' + content)])
self._run_check('<![CDATA[' + content,
[('comment', '![CDATA[' + content)],
[('comment', '[CDATA[' + content)],
collector=EventCollector(autocdata=True))
self._run_check('<svg><text y="100"><![CDATA[' + content,
[('starttag', 'svg', []),