Re: [xml] patch: support <embed> in HTML parser



Hi Daniel,

Is endTag=1 correct? (means the end tag can be omitted).

 other elements would close it then. I must admit I don't fully remember
the algorithm ...

Actually it looks a little bit more complicated still, as the embed element *is* empty, but still has a close tag:

    <embed></embed>

Presumably this is for compatibility with browsers that don't recognise it specially like img, and would get confused if it didn't close.

In theory this should require setting empty=1 and endTag=1, to indicate that the element is empty but that end tag can be omitted. However, the HTML parser does not really support this: if empty=1 it will complain when it sees an end tag, even if there is no content in the element.

The next best alternative is to set empty=0 and endTag to 0, 1 or 3; it doesn't seem to matter which.

Doing a quick grep in HTMLparser.c, it seems that endTag is only ever compared with 3, and startTag is never checked at all (!) so maybe none of this is very critical, anyway :)

Best regards,

Michael

--
Print XML with Prince!
http://www.princexml.com



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