#180 Tidy strips empty StartEndTags even for empty elems

closed-fixed
5
2002-04-07
2002-04-05
No

Tidy (April 1, 2002 version) strips out all the IMG tags (claiming they are empty)!

Here is my .tidyrc:

wrap: 64
indent: no
indent-spaces: 4
add-xml-decl: yes
#output-xhtml: yes
break-before-br: yes
clean: yes
logical-emphasis: yes
enclose-text: yes
enclose-block-test: yes

and here is a small example file:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>title</title>
</head>
<body>
<img src="unst001s.png" alt="USA flag" />
</body>
</html>

Run tidy -m on that and the img tag goes away.

Discussion

  • Anonymous - 2002-04-06
    • milestone: --> Future - all platforms
     
  • Anonymous - 2002-04-06

    Logged In: YES
    user_id=225318

    I was able to reproduce your problem with the current (05 Apr
    02) version of Tidy on my platform (without using the -m
    option). I also confirmed the bug didn't occur with the 04
    Aug 00 version on my platform.

    However, where did you get this version of Tidy from? You
    claim it is a April 2002 binary, but the Tidy meta tag says :

    <meta name="generator" content="HTML Tidy, see www.w3.org" />

    which doesn't match the April 2002 source in CVS.

    This may indicate that the HTML source was originally
    processed with older versions of Tidy, although newer
    versions of Tidy are supposed to update the Tidy meta tag to
    the current format (in fact I just verified that it does).

    Maybe you edited the information created by Tidy, for the
    purposes of posting this bug report.

    Otherwise, this indicates your binary was not built from
    current sources (or even sources in the past year; more
    likely a mixture of sources). It makes it hard to support a
    version of Tidy we don't know about.

    What platform are you running Tidy on? Please use "tidy -v"
    and provide more information.

    Uploaded test case to CVS.

     
  • Klaus Johannes Rusch

    Logged In: YES
    user_id=365576

    Looks like the XHTML trailing slash in the image tag confuses tidy, this one

    <html>
    <body>
    <img src="unst001s.png" alt="USA flag" />
    </body>
    </html>

    fails while

    <html>
    <body>
    <img src="unst001s.png" alt="USA flag" >
    </body>
    </html>

    works okay.

     
  • Björn Höhrmann

    • assigned_to: nobody --> hoehrmann
    • summary: Tidy strips all the IMG tags out! --> Tidy strips empty StartEndTags even for empty elems
    • status: open --> closed-fixed
     
  • Björn Höhrmann

    Logged In: YES
    user_id=188003

    This bug has been introduced by my fix to bug 531964.
    Constructs like <p /> should be trimmed and my fix enabled
    Tidy to do so, by checking whether StartEndTags should be
    trimmed, however, if an element has an empty content model,
    we should not remove it from the tree, this is fixed in
    CVS.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks