W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 1999

Possible problem: if FONT is only child of parent <td> element.. .

From: Shane Harrelson <SHarrelson@matrasystems.com>
Date: Mon, 27 Sep 1999 14:34:03 -0400
Message-ID: <E1365FF34490D21186AF00600841F039273213@EXCHANGE>
To: "'html-tidy@w3.org'" <html-tidy@w3.org>
Hello everyone-

I'm new to the list, and I've found what I believe to
be a problem in Tidy.  I realize those are famous newbie
last words, so please hear me (or read me) out.

Consider the following sample HTML File with a single table,
containing a single element, with a specified font:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title></title>
</head>
<body>
<table>
<tr>
<td><font face="arial" size=5>first font</font></td>
</tr>
</table>
</body>
</html>

After running though Tidy with a the following config file:

// config file for HTML tidy
markup: yes
clean: yes
show-warnings: yes

I get the following (incorrect) output:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title></title>
</head>
<body>
<table>
<tr>
<td>first font</td>
</tr>
</table>
</body>
</html>

Note that my font specification for the table element
has been removed.  Ideally, I think something like the 
following should have been generated (note that the 
font specification was converted to a class and assigned
to the parent <td> element):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title></title>
<style type="text/css">
 td.c1 {font-family: arial; font-size: 150%}
</style>
</head>
<body>
<table>
<tr>
<td class="c1">first font</td>
</tr>
</table>
</body>
</html>

Less ideal, but still acceptable would have been the
following (note that the font specification for the
table element has been converted to a <span> and class):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title></title>
<style type="text/css">
 span.c1 {font-family: arial; font-size: 150%}
</style>
</head>
<body>
<table>
<tr>
<td><span class="c1">first font</span></td>
</tr>
</table>
</body>
</html>

Is there an option to achieve either of the desired results
above?  From looking at the source, this seems to have been
an intentional "effect" of the Font2Span() clean-up
code which discards a <font> tag that is the only child 
of *any* parent element.

Can anyone offer any suggestions or confirmations?

Thanks.
-Shane
Received on Monday, 27 September 1999 14:34:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:42 GMT