W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2002

Bug: HTML Tidy and tidying up Server-side Includes (SSI)

From: PRICE, Paul <Paul.Price@qed.qld.gov.au>
Date: Thu, 21 Feb 2002 21:52:53 -0500 (EST)
Message-ID: <C7A0A0979B09D311877400A024B3D410041B2069@eco88340009.qed.qld.gov.au>
To: "'html-tidy@w3.org'" <html-tidy@w3.org>
~~ BUGS REPORT - HTMLTIDY WIN32 VERSION (AND MAYBE OTHER PORTS) ~~

* EXPECTED RESULT: I want to take a Server-Side Include HTML file and tidy
it up. The file only contains the information which would normally appear
*inside* of but not including the <BODY> tag. As server-side includes work
by embedding commands in HTML comments ( for instance <!--#include
virtual="/ssi/file.shtml" --> ) all comments should be preserved and in
addition preserved as-is.

* POSSIBLE BUG: The first SSI HTML comment either gets placed in the wrong
location in the output or stripped altogether.

The source HTML file follows:

-- Start ----------------------------------------------

<!--#include virtual="/ssi/header.html" -->
<h2>Test Header</h2>
<p>Test paragraph</p>
<!--#include virtual="/ssi/footer.html" -->

-- End ------------------------------------------------


***************
*** BUG ONE ***
***************

Command: `tidydbg.exe file.shtml`

Result: Notice how the SSI is placed in the wrong place at the TOP of the
output (first line). It should be INSIDE the body tag!!

Possibility: My guess is that htmltidy is viewing the first comment line in
the file as if it is the doctype; however, this is incorrect behaviour in
this case.

-- Start ----------------------------------------------

<!--#include virtual="/ssi/header.html" -->
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy for Windows (vers 1st January
2002), see www.w3.org">
<title></title>
</head>
<body>
<h2>Test Header</h2>

<p>Test paragraph</p>

<!--#include virtual="/ssi/footer.html" -->
</body>
</html>

-- End ------------------------------------------------


***************
*** BUG TWO ***
***************

Command: `tidydbg.exe --show-body-only yes file.shtml`

Result: Notice how the *first* SSI comment DISAPPEARS without a trace!

Possibility: My guess is that htmltidy is viewing the first comment as a
part of the <HEAD> and stripping it; however this is incorrect behaviour in
this case.

-- Start ----------------------------------------------

<h2>Test Header</h2>

<p>Test paragraph</p>

<!--#include virtual="/ssi/footer.html" -->

-- End ------------------------------------------------
Received on Monday, 25 February 2002 10:11:46 GMT

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