[New-bugs-announce] [issue13960] Handling of broken comments in HTMLParser

Ezio Melotti report at bugs.python.org
Tue Feb 7 12:56:36 CET 2012


New submission from Ezio Melotti <ezio.melotti at gmail.com>:

html.parser fails to handle the following invalid comments:
<! foo >
<! bar -->
<! -- baz -->
The attached patch follows the HTML5 specs [0], and parses them as "bogus comments".  Currently the patch fixes the problem only when strict=False, but it might be better to make this the default behavior and apply it to 2.7 too.

[0]: http://www.w3.org/TR/html5/tokenization.html#bogus-comment-state

----------
components: Library (Lib)
files: issue13960.diff
keywords: patch
messages: 152806
nosy: eric.araujo, ezio.melotti
priority: normal
severity: normal
stage: patch review
status: open
title: Handling of broken comments in HTMLParser
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24443/issue13960.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13960>
_______________________________________


More information about the New-bugs-announce mailing list