[issue25258] HtmlParser doesn't handle void element tags correctly

2015-10-03 Thread Chenyun Yang
Chenyun Yang added the comment: handle_startendtag is also called for non-void elements, such as , so the override example will break in those situation. The compatible patch I proposed right now is just one liner checker: # http://www.w3.org/TR/html5/syntax.html#void-elements <ht

[issue25258] HtmlParser doesn't handle void element tags correctly

2015-10-02 Thread Chenyun Yang
Chenyun Yang added the comment: Correct for previous comment, consistent -> not consistent On Fri, Oct 2, 2015 at 1:16 PM, Chenyun Yang wrote: > > Chenyun Yang added the comment: > > I am fine with either handle_startendtag or handle_starttag, > > The issue is that the b

[issue25258] HtmlParser doesn't handle void element tags correctly

2015-10-02 Thread Chenyun Yang
Chenyun Yang added the comment: I am fine with either handle_startendtag or handle_starttag, The issue is that the behavior is consistent for the two equally valid syntax ( and are handled differently); this inconsistent cannot be fixed from the inherited class as (handle_* calls are

[issue25258] HtmlParser doesn't handle void element tags correctly

2015-10-02 Thread Chenyun Yang
Chenyun Yang added the comment: the example you give for is a different case. , are void elements which are allowed to have no close tag; without is a browser implementation detail, most browser autocompletes . Without the parser calls the handle_endtag(), the client code which uses

[issue25258] HtmlParser doesn't handle void element tags correctly

2015-09-29 Thread Chenyun Yang
Chenyun Yang added the comment: I think the bug is mostly about inconsistent behavior: and shouldn't be parsed differently. This causes problem in the case that the parser won't be able to know consistently whether it has ended the visit of tag. I propose one fix which will

[issue25258] HtmlParser doesn't handle void element tags correctly

2015-09-28 Thread Chenyun Yang
New submission from Chenyun Yang: For void elements such as (, ), there doesn't need to have xhtml empty end tag. HtmlParser which relies on the XHTML empty end syntax failed to handle this situation. from HTMLParser import HTMLParser # create a subclass and override the handler me