W3C home > Mailing lists > Public > www-validator@w3.org > April 2011

Re: Problem with w3c-Validator

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sun, 24 Apr 2011 22:15:45 +0300
Message-ID: <696E94B217C6415E87F3480BB63D61DB@JukanPC>
To: <info@planb-deutschland.de>
Cc: <www-validator@w3.org>
Leif H Silli wrote:

> The HTML 4 validator considers that the string </ ends the script
> element. That string is present in  in end tags. There is no end tag
> for the img element. But <a> has one.

I'd just like to add a reference to the part of HTML 4.01 spec that 
discusses the issue:
http://www.w3.org/TR/html401/appendix/notes.html#h-B.3.2

As it mentions, the problem can be circumvented by "escaping" the slash with 
a backslash, changinh
"...</a>..."
to
"...<\/a>..."

Alternatively, one can break the string to pieces so that the string "</" 
does not appear, e.g. using string catenation in JavaScript:
"...<" + "/a>..."

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 
Received on Sunday, 24 April 2011 19:16:28 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:31:06 UTC