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

Re: Tidy gets over-zealous

From: Sebastian Lange <lange@cyperfection.de>
Date: Mon, 10 Jul 2000 10:23:25 +0200
Message-Id: <>
To: html-tidy@w3.org
Hello Chris,

Tidy is right about this warning, please check the HTML Reference's 

You'll have to mask your '</' with a backslash ('<\/'), in order to produce 
valid HTML, just as you'll have to mask '&' with '&amp;' when you are 
writing URLs.

Examples straight from that page:

                 <SCRIPT type="text/javascript">
                   document.write ("<EM>This won't work</EM>")

                <SCRIPT type="text/javascript">
                  document.write ("<EM>This will work<\/EM>")

Some more information you may find on 

         Technically, the first occurrence of "</"
         followed by any letter is considered the end tag
         for the SCRIPT element. While browsers are
         forgiving in this, authors should avoid using
         strings such as "</P>" in their embedded scripts.
         JavaScript allows authors to use a backslash to
         avoid ending the SCRIPT element prematurely,
         e.g., document.write("<\/P>").



At 23:17 09.07.2000 -0400, Chris Knight wrote:
>Tidy gives me: "Warning: '<' + '/' + letter not allowed here"
>when it finds JavaScript which writes HTML code containing '</'.
>I think Tidy should just skip over whatever is between <SCRIPT> and
>My 2 cents.
>Christopher Knight, Technical Communicator
>E-mail: cknight@attcanada.ca
>Phone: (604) 877-0074

Sebastian Lange
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:
Received on Monday, 10 July 2000 04:26:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:48 UTC