Re: [xml] [PATCH] Visible HTML elements close the head tag

On Fri, Jul 27, 2012 at 03:42:27PM -0700, conrad irwin gmail com wrote:
From: Conrad Irwin <conrad irwin gmail com>

Hi Xml,

In HTML email it's common to find arbitrary fragments of HTML, the one
that triggered this change was of the form:


Before this change the <font> tag was part of the implicit <head> that
gets created for the <meta> tag, after this change, it is part of the
 <body>, which more closely matches the behaviour of modern HTML

Is there a good reason that these tags didn't close the <head> tag

  Well, it's a bit hard to tell, that could simply be that nobody
though about such case scenario ... That's the problem of real life
html parsing, you will end up with <DOCTYPE> in the middle of the
<body> and with <p> within the head ...
  And it's a complete pain to know what's best to adopt as a stategy
when dealing with such an error except looking at what various browser
seems to do under the hood and try to mimick it :-\

I'm also not sure about applet/embed/object, so I've left them
out of the list for now.

  Yeah until someone screams to have them in I would rather keep as-is

It might be better to move towards a more-HTML-5-based approach where
any non-head-supported tag causes the <head> to be closed. See Section The "in head" insertion mode. [1] But I'm not sure what the
current plans are for HTML-5 in libxml2?

  Yeah at least that's one of the good point of HTML5 if it ends up as
a process, it would give a clear indication on how to process the usual
mistakes. We discussed this before, I'm not too tempted to embedd
directly an external parser code within libxml2, but I would love to see
the existing parser either improved along the lines of HTML5 errors
handling or a new specific mode added to the HTML parser indicating
to follow HTML5 rules.
  The problem is not willingness to do this but the time needed to do so
and clearly I won't have time for such an effort myself at least in the
short term future.

  So for the good part, I applied our patch, thanks a lot !


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine
I | virtualization library

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]