[docs] Minor mistake on HTMLParser docs

Eric Higgins erichiggins at gmail.com
Mon Aug 5 23:13:36 CEST 2013


Greetings,

There's a minor mistake on the doc page for the HTMLParser
module<http://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
HTML4<http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2>and
HTML5 <http://dev.w3.org/html5/markup/syntax.html#syntax-attr-unquoted>attribute
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20130805/9fda78bc/attachment.html>


More information about the docs mailing list