This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Chenyun Yang
Recipients Chenyun Yang, ezio.melotti, josh.r, martin.panter, xiang.zhang
Date 2015-10-02.20:21:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAJZGQB6X9g+uyqOamMXP56JCLFptWZSN_X-h1E0ye1iLakcp2Q@mail.gmail.com>
In-reply-to <CAJZGQB6YCdF6YpODSa-2FOnOG01ZV8ms1Adc-_ppBpe3-ahHMA@mail.gmail.com>
Content
Correct for previous comment, consistent -> not consistent

On Fri, Oct 2, 2015 at 1:16 PM, Chenyun Yang <report@bugs.python.org> wrote:

>
> 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 (<img> and <img/> are handled differently); this inconsistent cannot
> be fixed from the inherited class as (handle_* calls are dispatched in the
> internal method of HTMLParser)
>
> On Fri, Oct 2, 2015 at 12:42 PM, Ezio Melotti <report@bugs.python.org>
> wrote:
>
> >
> > Ezio Melotti added the comment:
> >
> > Note that HTMLParser tries to follow the HTML5 specs, and for this case
> > they say [0]:
> > "Set the self-closing flag of the current tag token. Switch to the data
> > state. Emit the current tag token."
> >
> > So it seems that for <img />, only the <img> (and not the closing </img>)
> > should be emitted.  HTMLParser has no way to set the self-closing flag,
> so
> > calling handle_startendtag seems the most reasonable things to do, since
> it
> > allows tree-builders to set the flag themselves.  That said, the default
> > implementation of handle_startendtag should indeed just call
> > handle_starttag, however this would be a backward-incompatible change.
> >
> > [0]: http://www.w3.org/TR/html5/syntax.html#self-closing-start-tag-state
> >
> > ----------
> > type:  -> behavior
> >
> > _______________________________________
> > Python tracker <report@bugs.python.org>
> > <http://bugs.python.org/issue25258>
> > _______________________________________
> >
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue25258>
> _______________________________________
>
History
Date User Action Args
2015-10-02 20:21:29Chenyun Yangsetrecipients: + Chenyun Yang, ezio.melotti, martin.panter, josh.r, xiang.zhang
2015-10-02 20:21:29Chenyun Yanglinkissue25258 messages
2015-10-02 20:21:29Chenyun Yangcreate