Re: Patch for "HTML5" support

Bjoern Hoehrmann <[email protected]> Tue, 10 Jan 2012 16:43:05 +0100
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
* Geoff McLane wrote:
>So sorry for my lack of response on this HTML 5 =

>support issue, which I am VERY interested in,

You are the first to comment with any substance.

>Had to make two small fixes to get the patched =

>version to compile... not sure if 'patch' made =

>a mistake or something... in src/attrs.c and =

>src/tidylib.c
>
>--- tidy-new/src/attrs.c    2012-01-09 20:31:53.000000000 +0100
>+++ tidy/src/attrs.c    2012-01-10 13:17:04.000000000 +0100
>@@ -408,9 +408,6 @@
>     if (TY_(AttributeVersions)(node, attval) & VERS_ALL)
>         return no;
> =

>-    if (AttributeVersions(node, attval) & VERS_ALL)
>-        return no;
>-
>     return yes;
> }

This should be `TY_(AttributeVersions)...`.
 =

>--- tidy-new/src/tidylib.c  2012-01-10 12:05:56.000000000 +0100
>+++ tidy/src/tidylib.c  2012-01-10 13:15:06.000000000 +0100
>@@ -1741,7 +1741,6 @@
>   AttVal* attval =3D tidyAttrToImpl( tattr );
>   uint versions =3D TY_(AttributeVersions)(NULL, attval);
>   return versions & VERS_PROPRIETARY !=3D 0 ? yes : no;
>-  return isProprietary;
> }

You used html5-for-html-tidy.patch; use html5-for-html-tidy.patch-2,
<http://lists.w3.org/Archives/Public/www-archive/2011Nov/0007.html>.

>diff -u base/out_655338.html tmp/out_655338.html
>--- base/out_655338.html    2012-01-10 13:31:18.000000000 +0100
>+++ tmp/out_655338.html 2012-01-10 13:32:50.000000000 +0100
>@@ -1,10 +1,7 @@
> <?xml version=3D"1.0" encoding=3D"iso-8859-1"?>
>-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
> =

>-<html lang=3D"en"
>-      xml:lang=3D"en"
>-      xmlns=3D"http://www.w3.org/1999/xhtml">
>+<html lang=3D"en">

This looks like a bug in my patch, if you get something else without
the patch.

>diff -u base/msg_1715153.txt tmp/msg_1715153.txt
>--- base/msg_1715153.txt    2012-01-10 13:31:18.000000000 +0100
>+++ tmp/msg_1715153.txt 2012-01-10 13:32:50.000000000 +0100
>@@ -3,9 +3,19 @@
> line 1 column 1 - Warning: missing <!DOCTYPE> declaration
> line 1 column 1 - Warning: inserting implicit <body>
> line 1 column 1 - Warning: inserting missing 'title' element
>+line 1 column 1 - Warning: <embed> proprietary attribute "src"
>+line 1 column 1 - Warning: <embed> proprietary attribute "quality"
>+line 1 column 1 - Warning: <embed> proprietary attribute "mode"
> line 1 column 1 - Warning: <embed> attribute "bgcolor" had invalid
>value "FFFFFF" and has been replaced
>+line 1 column 1 - Warning: <embed> proprietary attribute "bgcolor"
>+line 1 column 1 - Warning: <embed> proprietary attribute "width"
>+line 1 column 1 - Warning: <embed> proprietary attribute "height"
>+line 1 column 1 - Warning: <embed> proprietary attribute "lign"
>+line 1 column 1 - Warning: <embed> proprietary attribute
>"allowscriptaccess"
>+line 1 column 1 - Warning: <embed> proprietary attribute "type"
>+line 1 column 1 - Warning: <embed> proprietary attribute "pluginspage"
> Info: Document content looks like HTML Proprietary
>-6 warnings, 0 errors were found!
>+16 warnings, 0 errors were found!

This looks like a bug has been fixed by the patch (if you don't get
the warnings without it), but it probably would make sense to check
how the patch changes the `embed` element.

>diff -u base/msg_655338.txt tmp/msg_655338.txt
>--- base/msg_655338.txt 2012-01-10 13:31:18.000000000 +0100
>+++ tmp/msg_655338.txt  2012-01-10 13:32:50.000000000 +0100
>@@ -2,6 +2,7 @@
> line 7 column 1 - Warning: inserting implicit <body>
> Info: Doctype given is "-//W3C//DTD HTML 4.0 Transitional//EN"
> Info: Document content looks like XHTML 1.0 Strict
>+Info: No system identifier in emitted doctype

This is just a result of the problem above.

>On the suggestion I read somewhere about changing to =

>using a 'newer' repository system, like 'git', =

>personally I see no particular reason to abandon =

>sourceforge/cvs for this relatively small tidy =

>project...

Proposing and applying patches would be easier on "GitHub", but that
would require someone looking at them regularily, so, there isn't a
big difference without someone volunteering.

>And also what to do about these 'forks'?

These forks apply patches without understanding the purpose of the code
they are patching, like removing accessibility warnings due to "HTML5"
conformance requirements. Given that none of the people involved there
made any effort to coordinate their modifications here or offlist, I'm
going with the "ignore them" approach currently.

>It seems only in Bj=F6rn's patch that both HTML 5 =

>and XML are added, with 2 new values in lexer.h
>
>/* "HTML5" */
>#define HT50              131072u
>#define XH50              262144u
>
>But maybe these forks do it all a different way?

That seems unlikely, but I haven't checked.
-- =

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/ =


---------------------------------------------------------------------------=
---
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create =

new or port existing apps to sell to consumers worldwide. Explore the =

Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev