W3C home > Mailing lists > Public > www-validator@w3.org > March 2013

Re: Meta - Escaped quote should be OK - HTML4 strict (email)

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Fri, 15 Mar 2013 10:37:10 +0200
Message-ID: <5142DDB6.2030101@cs.tut.fi>
To: Denis TRUFFAUT <denis.truffaut@gmail.com>
CC: www-validator@w3.org
2013-03-14 15:40, Denis TRUFFAUT wrote:

>          <meta name='description' content='\''>
[...]
> ... Fails
>
> The only difference is the &#039; transformed into \'
>
> Escaped quotes should be considered as valid.

No, \' is not an escaped quote in HTML. Whatever it might mean in other 
languages and notations (including some that might be used to generate 
an HTML document or as embedded in an HTML document), in HTML \' is 
simply two separate characters with no special meaning.

Hence, when \' occurs in an attribute value within single quotes (i.e., 
Ascii apostrophes, '), the single quote is invalid quite independently 
of the character before it. Or, in terms of parsing, the single quote 
terminates the attribute value, leaving the next single quote (that was 
meant to terminate the value) homeless and, in this context, invalid.

P.S. There should seldom be any need for using the Ascii apostrophe 
within a content attribute. The Ascii apostrophe is used in computer 
languages, but a meta description is supposed to be in a human language, 
with e.g. “don’t” rather than “don't”.

Yucca
Received on Friday, 15 March 2013 08:41:51 GMT

This archive was generated by hypermail 2.3.1 : Friday, 15 March 2013 08:41:53 GMT