Re: teach tidy new attributes ??

* Michael A. Peters wrote:
>Also, when defining new elements, how do I specify what attributes are 
>allowed? Seems that adding a new element allows any attribute.

Tidy is not a full Validator that spots and reports every error in the
document, rather it will try to correct them automatically and at times
log such corrects; it will also report on problems that it cannot fix
automatically. You need to declare new elements because otherwise Tidy
would not know how to parse them (e.g., it needs to know whether an e-
lement can have children or not). Attributes will simply be copied in-
to the output, so there is no need to declare them, other than to si-
lence the corresponding warnings.

>I'm guessing that there won't be a release of tidy that internally 
>supports html 5 until after the spec is finished, but if I can teach 
>tidy about new attributes I don't really need a new tidy.

If someone offers a coherent patch and can be expected to maintain the
support as changes are made to the language definition, I would be in-
clined to accept the patch. So far I know of nobody to work on this, I
would rather assume that people would write a proper "HTML5 parser" and
that might eventually displace HTML Tidy, perhaps adopting some of the
cleanup and pretty printing routines.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Tuesday, 2 February 2010 08:21:31 UTC