Minor mistake on HTMLParser docs
5 Aug
2013
5 Aug
'13
4:13 p.m.
Greetings, There's a minor mistake on the doc page for the HTMLParser modulehttp://docs.python.org/2/library/htmlparser.html . The last snippet labeled: "*Parsing invalid HTML (e.g. unquoted attributes) also works:*" is mistaken in assuming that unquoted attributes are invalid.
parser.feed('<p><a class=link href=#main>tag soup</p ></a>') ...
According to the HTML4http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2and HTML5 http://dev.w3.org/html5/markup/syntax.html#syntax-attr-unquotedattribute syntax spec, the example you provide are actually perfectly valid attribute definitions. You could add a space or other breaking/invalid character to the attribute value to correct it. Thanks! -Eric Higgins
3914
Age (days ago)
3914
Last active (days ago)
0 comments
1 participants
participants (1)
-
Eric Higgins