On Mon, Dec 01, 2008 at 06:56:12PM +0100, Johannes Hofmann wrote:
Hi,
while working on css I came across the following:
<a class="d" name="INCR32"/> (found at [1])
dillo currently doesn't recognize that the element is empty. The relevant code is at html.cc:3530:
/* Test for </x>, ReqTagClose, <x /> and <x/> */ if (*start == '/' || /* </x> */ html->ReqTagClose || /* request */ (tag[tagsize - 2] == '/' && /* XML: */ (isspace(tag[tagsize - 3]) || /* <x /> */ (size_t)tagsize == strlen(Tags[ni].name) + 3))) { /* <x/> */
We could simply drop the requirement for the blank before '/' which would lead to
/* Test for </x>, ReqTagClose, <x /> and <x/> */ if (*start == '/' || /* </x> */ html->ReqTagClose || /* request */ (tag[tagsize - 2] == '/')) { /* XML */
or allow a '"' instead of the blank or keep things as they are, if XML requires a blank before the '/'.
From http://www.w3.org/TR/2006/REC-xml-20060816/#sec-starttags I'd say the blank is optional.
What do you think?
Cheers, Johannes
[1] http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/...
Oh, I committed a new version allowing [ "'] before />, and also a self closing element: <x/>. This because the former one failed on things like: <a href=/html/k_links/Kayden_Kross/> Kayden Kross </a> Example taken from: http://www.freeones.com/html/d_links/Denise_Milani/ look at the non-working bottom links, or elsewhere if you like. :-) -- Cheers Jorge.-