Re: Patch for "HTML5" support

Bjoern Hoehrmann <[email protected]> Sat, 14 Jan 2012 21:21:31 +0100
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
* Geoff McLane wrote:
>Considering test 655338 we have a difference between
>when initially tidying the input with a mis-placed
>xml declaration, and then when tidying that output...
>I shall call them Case 1 and Case 2...

Thanks for looking into this. I checked this myself now and it seems the
problem is the xml:lang attribute was VERS_XML before my patch but isn't
anymore, and an XML declaration apparently does not trigger `isvoyager`,
so Tidy thinks this is meant to be HTML while without my patch it treats
it as XHTML. Adding VERS_XML to W3CAttrsFor_HTML's TidyAttr_XML_LANG en-
try fixes this problem. A better solution would probably be to change
the check in CheckAttribute(). I also note that attrdict.c disallows the
xml:lang attribute in "XHTML5" for all elements, that's of course a bug.

The effect in CheckAttribute is basically that documents with xml:space
or xml:lang (or a `version` or `encoding` attribute apparently) become
`isvoyager`, so this should probably simply check for xml:space/lang in-
stead of `AttributeVersions(node, attval) & VERS_XML`.
-- =

Bj=F6rn H=F6hrmann =B7 mailto:[email protected] =B7 http://bjoern.hoehrma=
nn.de
Am Badedeich 7 =B7 Telefon: +49(0)160/4415681 =B7 http://www.bjoernsworld.de
25899 Dageb=FCll =B7 PGP Pub. KeyID: 0xA4357E78 =B7 http://www.websitedev.d=
e/ =


---------------------------------------------------------------------------=
---
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2