Re: Tidy putting spurious "/" into tags

Hello Terry,

Tidy is right about what it's doing - the input file does not appear to be 
valid XHTML 1.0.
I used the WDG Validator 
[http://www.htmlhelp.com/tools/validator/direct.html] because it allows 
direct HTML input, while the W3C Validator [http://validator.w3.org/] only 
allows URL and uploaded File validation, yet I believe them to be fairly 
identical.

Please see following snippets from the reference:

"Empty elements must either have an end tag or the start tag must end with 
/>. For instance, <br/> or <hr></hr>."
[http://www.w3.org/TR/xhtml1/#h-4.6]

"Include a space before the trailing / and > of empty elements, e.g. <br 
/>, <hr /> and <img src="karen.jpg" alt="Karen" />. Also, use the minimized 
tag syntax for empty elements, e.g. <br />, as the alternative syntax 
<br></br> allowed by XML gives uncertain results in many existing user agents."
[http://www.w3.org/TR/xhtml1/#guidelines]

The output file ALMOST validates, the validator still complains about the 
LEFTMARGIN and TOPMARGIN attributes in BODY.
I have mentioned this before, it would be a very nice addition if tidy 
would allow to suppress "illegal" attributes.


Sebastian

At 01:16 11.07.2000 -0700, Terry Teague wrote:
>Dear Folks,
>
>One of my users has reported a problem when tidying his XHTML on the Mac
>platform. I have since reproduced his problem with the Windows versions of
>Tidy, so this is a non-platform specific problem that I look to your advice
>on.
>
>I am able to reproduce the problem with both the 30 Apr 00 and 08 Jul 00
>versions.
>
>Here is his original comment :
>
> >I'm evaluating BBTidy 1.0b6 on my Macintosh G3, OS 8.6. BBTidy for
> >BBedit consistently inserts " /" in a number of tags when tidying up
> >PageSpinner 2.1 for PPC files. I've attached my original file, the
> >output file, and my config file. I hope you can help me figure this
> >out, as I think your program is great and would like to use it on an
> >ongoing basis.
>
>Here is his config file :
>
>indent: auto
>indent-spaces: 2
>wrap: 72
>markup: yes
>clean: no
>output-xml: no
>input-xml: no
>show-warnings: yes
>numeric-entities: yes
>quote-marks: yes
>quote-nbsp: yes
>quote-ampersand: no
>break-before-br: no
>uppercase-tags: yes
>uppercase-attributes: yes
>smart-indent: no
>output-xhtml: yes
>char-encoding: latin1
>new-inline-tags: mind-it-ignore, /mind-it-ignore
>tidy-mark: no
>logical-emphasis: yes
>drop-empty-paras: no
>alt-text: image
>
>Here is a small portion of his input HTML ("index.shtml") that demonstrates
>the problem. The entire file can be provided on request :
>
><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
>And is is the tidied output of the above :
>
>See the trailing "/>" above.
>
>Regards, Terry

--
Sebastian Lange
http://www.sl-chat.de/
Maybe the first chat site that validates as HTML
4.0 even though user input may contain HTML codes.

Courtesy to Dave Raggett's HTML Tidy:
http://www.w3.org/People/Raggett/tidy/

Received on Tuesday, 11 July 2000 04:50:24 UTC