1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
5
<meta name="generator" content="HTML Tidy, see www.w3.org" />
6
<title>HTML TIDY - Notes on pending work</title>
8
content="HTML, validation, error correction, pretty-printing" />
9
<meta name="author" content="Dave Raggett <dsr@w3.org>" />
10
<style type="text/css">
14
font-family: sans-serif
16
h1 { margin-left: -8% }
17
h2,h3,h4,h5,h6 { margin-left: -4% }
18
pre { color: green; font-weight: bold;
19
font-size: 80%; font-family: monospace}
20
em { font-style: italic; font-weight: bold }
21
strong { text-transform: uppercase; font-weight: bold }
22
.note {font-style: italic; color: rgb(192, 101, 101) }
23
//hr {text-align: center; width: 60% }
29
font-family: "Comic Sans MS", "Times New Roman", serif
32
font-family: sans-serif;
34
background: rgb(255,255,153)
39
.people {font-family: "Lucida Calligraphy", serif}
40
:link { color: rgb(0, 0, 153) }
41
:visited { color: rgb(153, 0, 153) }
42
:active { color: rgb(255, 0, 102) }
43
a :hover { color: rgb(0, 0, 255) }
46
<style type="text/css">
47
p.c1 {font-style: italic}
50
<body bgcolor="#FFFFFF" background="grid.gif" text="black"
51
link="navy" vlink="black" alink="red">
52
<h1>HTML TIDY - Notes on Pending Work</h1>
54
<p><a href="http://www.w3.org/People/Raggett">Dave Raggett</a> <a
55
href="mailto:dsr@w3.org">dsr@w3.org</a></p>
57
<p>This is a page where I am keeping the suggestions for
58
improvements or bug fixes. My current work load means that I
59
don't get much time to work on HTML Tidy, so I am interested in
62
<h4>Public Email List for Tidy: <<a
63
href="mailto:html-tidy@w3.org">html-tidy@w3.org</a>></h4>
65
<p>I have set up an archived mailing list devoted to Tidy. To
66
subscribe send an email to html-tidy-request@w3.org with the word
67
subscribe in the subject line (include the word unsubscribe if
68
you want to unsubscribe). The <a
69
href="http://lists.w3.org/Archives/Public/html-tidy/">archive</a>
70
for this list is accessible online. Please use this list to
71
report errors or enhancement requests.</p>
73
<h2>Things awaiting further attention</h2>
76
<li>Support for BIG5 and ShiftJIS (Rick Jelliffe)</li>
78
<li>Stronger checking on which attributes appear on what
81
<li>Sorting attributes in a canonical order</li>
83
<li>Version checking for HTML 4.01 vs 4.0 (Tidy currently will
84
set the document type to 4.01 in preference to 4.0)</li>
86
<li>Noticing that the document isn't really XHTML if it isn't
87
wellformed, i.e. it lacks end tags and quotes on attribute
90
<li>Converting <font face="Symbol">a</font> etc. to
91
the corresponding Unicode characters, when cleaning HTML.</li>
93
<li>link checking - this would involve some platform dependent
94
code as the network interface varies significantly from one
95
platform to the next.</li>
97
<li>When exporting Word2000 to Web page, there is a need for
98
smarter rules of thumb for working out whether the paragraph is a
99
bulletted or numbered list item, and determining the level of
100
nesting. Perhaps the style attribute holds the key? This tends to
101
include substrings like: "mso-list:l0 level1 lfo2;" and
102
"mso-list:l1 level1 lfo1;". Unfortunately, these aren't always
103
present, and I have yet to figure out a foolproof heuristic.</li>
106
<p>I need to set up an index of precisely what attributes are
107
supported on each element. Right now, some elements check their
108
own attributes, whilst others are checked via default checks
109
defined for each attribute independently of the element. Until
110
this is done, you sometimes find that validation services
111
discovering errors unnoticed by Tidy itself.</p>
113
<p>Jelks Cabaniss asks: <i>Could Tidy be made to automatically
114
"clean" (FONTs to CSS) if the Strict DOCTYPE is requested? An
115
HTML or XHTML Strict document can't have FONT tags according to
116
the DTDs</i>. Jelks has a bunch of other good ideas such as
117
converting the bgcolor attribute over to CSS.</p>
119
<p>Adding an option to select slide transition effects. I would
120
also like to provide an optional feature for sorting attribute
123
<p>I am having problems with form elements as direct children of
124
tr or table. It is dangerous to create an implicit table cell,
125
and what is needed is a way to move the form element into the
126
next cell. If this can't be done an error needs to be raised
127
since Tidy will be stuck. On a separate note, Tidy is still
128
breaking lines between <img> and </a> which in
129
Netscape shows as an underlined space. It's fine in IE.</p>
131
<p>Benjamin Holzman <bah@orientation.com> writes: I'm
132
wrapping tidy (release-date 2000.01.13) in some perl objects
133
(using SWIG), and CharEncoding being a global is a bit of a pain.
134
I was wondering what your thoughts would be on how to fix that.
135
The character encoding is already a property of struct Out; is
136
there any reason why making it part of struct StreamIn as well,
137
and perhaps setting that property in OpenInput, based on the
138
existing CharEncoding variable, wouldn't allow us to move
139
CharEncoding to be local to main?</p>
141
<p>Oh, in case you're curious about the API, here's a short
142
script using my wrappers to be an html to xhtml filter:</p>
149
my $tidy = Tidy->new(*STDIN);
150
my $document = $tidy->parse;
151
$tidy->as_xhtml(*STDOUT);
154
<p>Rick Parsons would like there to be a new wrap-attributes
155
option that can be used to suppress line wrapping within
156
attributes. There is already a similar option for JavaScript
159
<p>Vijay Patil would like tidy -h to display options sorted
162
<p>Julian Reschke would like there to be an option to add the
163
xml:space="preserve" attribute to pre elements when outputting
166
<p>Armando Asantos would like to use Tidy to produce a list of
167
URLs for images or hypertext links according to a config option.
168
This would be straightforward, but is a lower priority than bug
171
<p>Omri Traub would like an option to wrap the contents of style
172
and script elements in CDATA marked sections when converting to
173
XHTML. He is also interested in direct support for 16 bit
174
character file I/O.</p>
176
<p>Bertilo Wennergren notes:</p>
178
<blockquote>If I configure Tidy to "upgrade to style sheets", it
179
does so for a few things in my main document, but the code thus
180
created get error reports if I feed it back to Tidy. It turns out
181
that Tidy creates extra "class" attributes on tags that already
182
have "class" attributes set. This happens with this page:
183
<http://www.concinnity.se/bertilow/index.htm>.</blockquote>
185
<p>Randi Waki notes:</p>
188
<p>If a quoted URL attribute value (e.g., href in <a>
189
elements) contains a line break, 13-Jan-2000 Tidy changes the
190
line break to a space while IE and Netscape discard the line
191
break. This can result in a broken link in the tidied
194
<p>I believe the following change fixes the problem. In lexer.c,
195
insert the following lines before line 2502:</p>
198
/* discard line breaks in quoted URLs */
199
if (c == '\n' && IsUrl(name))
202
/* existing line 2502 */ c = ' ';
206
<p>Stephen Reynolds would like Tidy to keep track of whether a
207
comment started on a new line and preserve this in the
210
<p>Terry Teague says:</p>
213
<p>Sorry, I should have been more clear. Part of the problem is
214
the current HelpText() function in localize.c doesn't actually
215
reflect current reality.</p>
217
<p>You need to at least add the following line to HelpText()
221
tidy_out(out, " -version or -v show version\n");
224
<p>And I suppose it should mention the use of the new
225
"--<config options>" type syntax.</p>
227
<p>Regards, Terry</p>
230
<p>John Russel notes:</p>
234
1] does the specification indicate these are WRONG
235
2] if so why do they pass thru tidy ....
236
is url syntax such a can of worms that it is left to user
239
CASE 1: misuse of slash for folders
240
site had background="pics\fancy.jpg"
241
instead of "pics/fancy.jpg"
243
CASE 2: spaces in filename
244
site had href="coin album.html"
245
instead of "coin%20album.html"
248
<p>Andre Stechert would like a way to prevent Tidy from
249
"cleaning" newly declared elements which don't have any content
250
but do have end tags, see his mail of 17th January 2000</p>
252
<p>Todd Clark would like to use Tidy with Microsoft's WebClass
253
tags. Unfortunately these include unusual characters in the tag
254
names such as @ which Tidy objects to, for instance:</p>
257
<WC@DOMAINNAME>test.com</WC@DOMAINNAME>
260
<p>Perhaps it makes sense to offer an option to make Tidy less
261
picky about what characters it accepts in tag names. Or perhaps
264
<p>Jelks Cabaniss suggests an option to control dropping of empty
265
elements, e.g. according to what attributes they have.</p>
267
<p>Paavo Hartikainen writes:</p>
270
<p>Tidy always expands '&' to '&' even if I have
271
'quote-ampersand: no' defined in configuration file. This is not
272
a good thing to do for URLs that have '&' characters in them.
273
OS is Debian GNU/Linux 2.1 SPARC. Same thing happens on Alpha.
274
Other architectures I have not tried.</p>
276
<p>My configuration looks like this:</p>
279
char-encoding: latin1
282
logical-emphasis: yes
295
<p>Paul White reports that Tidy isn't recognizing HTML 3.2 when
296
the doctype is "-//W3C//DTD HTML 3.2 Final//EN" (as per the REC),
297
and similarly for HTML 4.01. This would appear to call for a
298
change to the table of names in lexer.c.</p>
300
<p>Stuart Hungerford would like Tidy to detect and fix duplicate
301
attributes e.g. multiple class attributes. Celeste Suliin Burris
302
would like Tidy to replace spaces in URLs by %20 as some versions
303
of Netscape "croak big time" on this. Denis Kokarev also wants
304
Tidy to remove duplicate attributes when the values are the same.
305
This apparently stops XSLT from working. Brian Schweitzer notes
306
that Tidy adds a 2nd class attribute rather than merging the
307
classes into a space separated list.</p>
309
<p>Bertilo Wennergren writes: Tidy seems not to recognize frame
310
elements with a closing "/". It actually removes them. Try his <a
311
href="http://www.concinnity.se/bertilow/pmeg/pmeg9/k_bazo.htm">example</a>.
312
Tidy can produce XHTML Frameset docs, but when fed them back</p>
314
<p>again it cries foul.</p>
316
<p>Jose Manuel Cerqueira Esteves notes:</p>
319
I've used `tidy' to convert a few HTML 4.0 files to XHTML 1.0 and noticed
320
a problem when dealing with constructs like
322
<small><small>some text</small></small>
324
First, `tidy' acts as if the second "<small>" was meant as a closing tag:
326
Warning: "<small> is probably intended as </small>"
328
Then it trims the resulting empty <small></small>:
330
Warning: trimming empty <small>
332
And finally both remaining closing tags ("</small>"), now spurious,
335
Warning: discarding unexpected </small>
336
Warning: discarding unexpected </small>
338
It would be convenient to have at least some `tidy' option to prevent this
339
from happening (or perhaps some different heuristics?).
342
<p>Robbert Hans Baron would like to see Tidy warning about
343
duplicate attributes and fixing these when the values are
346
<p>Jutta Wrage notes that: When parsing HTML 3.2 Pages, tidy
347
doesn't accept textareas in forms correctly. The HTML Reference
348
specification (HTML 3.2 Final) allows: name, rows and cols, but
349
upon seeing these Tidy thinks the document is 4.0.</p>
351
<p>Matthew Brealey notes that a heading start tag is coerced to
352
an end heading tag when the end tag is missing. This is
353
deliberate, but perhaps not the best heuristic.</p>
355
<p>HIYAMA Masayuki notes that Tidy should set the encoding
356
attribute to match the language encoding, e.g. ?xml version="1.0"
357
encoding="iso-2022-jp"?><.</p>
359
<p>Mark Modrall has extended Tidy to support selectively
360
stripping out listed tags and attributes, see his email of March
363
<p>Yong Taek Bae notes that with the omit end tags option Tidy
364
omits the body tag even if it has attributes. This is an
367
<p>Tapio Markula reports that Tidy is incorrectly replacing
368
accented characters in script elements by entities. The script
369
element (in HTML but not XHTML) is CDATA and as such entities
370
won't be expanded. This bug needs to be fixed along with the
371
support for CDATA sections.</p>
373
<p>Terrill Bennett reports tidy crashing when producing slides,
374
and when the -i option has been set. He later added the crash
375
occurs when the page doesn't include an h1 element. See
376
Terrill-Bennett-11mar00.txt.</p>
378
<p>Stephen Lewis notes that if an <hr> element is present
379
in the head before the title element, then Tidy gets confused and
380
adds in a spurious extra empty title element. This would be
381
avoided if Tidy could move the hr into the body before the body
382
element is encountered. This raises a number of problems for
383
instance working out when to copy in attributes from an explicit
386
<p>Carl Osterly would like Tidy to avoid breaking lines before or
387
after the = sign in attribute values when this is practical.
388
Perhaps a simple rule of thumb could be used to decide this?</p>
390
<p>Rick H Wesson notes that Tidy crashes on CDATA marked sections
391
when parsing XML.</p>
393
<p>Luigi Federici would like an option to set the DTD URI for XML
396
<p>Mat Sander notes: If I have php code the indentation behaves
397
strange. Repeated tidying php content and end tag indented one
398
level extra for each time. The result ends up something like
408
I have the fillowing config file for Tidy:
417
char-encoding: latin1
419
assume-xml-procins: yes
422
logical-emphasis: yes
423
drop-empty-paras: yes
425
fix-bad-comments: yes
439
<p>Don Hasson notes that if you make a mistake and leave off the
440
ending "/" in the <title> tag, tidy will generate an extra
441
set of <title>s.</p>
447
<head><title>No end here<title></head>
455
<p>produces this:</p>
460
<title>No end here</title>
461
<title></title>
470
<p>Jeff Wilkinson would like the HTML Tidy page to include
471
internal anchors so that he can link directly to the appropriate
474
<p>Peter Vince would like to be able to clean presentation
475
attributes on the body element, as well as translating b and i to
478
<p>Dave Bryan and Mathew Brealey would like there to be a way to
479
suppress the default handling of inline elements in favor of
480
simply inserting the appropriate end tag when encountering an
481
element that isn't allowed in an inline context. The default
482
behavior replicates the rendering on existing browsers but can
483
cause problems for hand editors.</p>
485
<p>Dave Bryan notes that tidy isn't updating the column position
486
when parsing attributes.</p>
488
<p>Can Tidy track when a line break occurs after a PI or comment
489
and reproduce this in the output? This idea occurred to me after
490
reading a comment from Brad Stowers.</p>
492
<p>One interesting suggestion is to make some of Tidy's rules of
493
thumb sensitive to the program that generated the markup as
494
indicated by the meta element. This would allow for greater
495
robustness in how the rules operate.</p>
497
<p>Dave Bryan would like the quiet mode to be tweaked to suppress
498
the general info at the end of the report. see
499
Dave-Bryan-24mar00.txt.</p>
501
<p>Erik Rossen would like an option to suppress line wrap within
502
tags, so that the tag is always on the same line regardless of
503
the number and length of the attributes.</p>
505
<p>Dan Satria suggest that the clean mechanism check to see if
506
there are any existing matching style rules before adding new
509
<p>Zoltan Hawryluk suggests mapping the Netscape layer tag into
510
the equivalent CSS positioning syntax.</p>
512
<p>Jim Walker says Tidy doesn't correctly report errors such as
513
<tt></</head></tt>.</p>
515
<p>Tidy's slide feature: see Johannes-Poutre-12jul00.txt</p>
517
<p>Carole Mah suggests Tidy should recover from multiple class
518
attributes on the same element.</p>
523
<li>Recursion through subdirectories, so you can fix up your
524
entire web site at one go. This assumes I can find a way that is
525
portable across a wide range of platforms!</li>
527
<li>Support for W3C's <a
528
href="http://www.w3.org/TR/REC-DOM-Level-1/">Document Object
529
Model</a> (DOM) level one.</li>
531
<li>Full validation of all attribute values.</li>
533
<li>Mapping Unicode bidi control characters to HTML tags.</li>
535
<li>Full support for parsing XML (still somewhat limited).</li>
537
<li>How to say which XML elements should be printed
540
<li>Acting on the XML encoding attribute, e.g.
541
<?xml encoding="iso-8859-1"></li>
543
<li>Improved mapping from HTML presentation attributes/elements
546
<li>Improved support for <a
547
href="http://java.sun.com/products/jsp/">JSP</a> (Java Server
550
<li>Ugly print option which removes all optional whitespace</li>