"& did not start a character reference."

2014-08-26 12:45, Neil Whitehead wrote
under Subject: Re: [VE][html5] Add Subject Here:

> I have received the error:
>
> “& did not start a character reference. (& probably should have been
> escaped as &.)”
>
> But the & was part of a url within a href=””, I am thinking there should
> be an exception for this?

For HTML5, the issue is messy and varies from draft to draft. Currently, 
in W3C HTML5 LC, the description of HTML parsing (!) rules at
http://www.w3.org/TR/html5/syntax.html#consume-a-character-reference
seem to say, in a fairly complicated manner, that e.g. &display=1 in an
attribute value causes “parse error” – even though browsers are required 
to process it so that “&” is taken as just a data character.

> Validating http://www.whitelayer.co.uk/p2/

Just replace any occurrence of “&” in an attribute value by “&” 
(unless the “&” is meant to be part of a character reference).

This won’t change anything in page behavior, but it pleases the Validator.

Yucca

Received on Wednesday, 27 August 2014 08:07:04 UTC