Ampersands in URLs in HTML

1999-05-26 21:24:08
At 10:18 PM 5/26/99 +0100, Mats Dufberg wrote:

Ampersand is legal in a URL, but it is a control character in HTML. If it
is legal depends on its position:

<a href="";>
                              ^                           ^
                              |                           |
           Legal, part of URL |                           |
               Here the ampersamd should be encoded as "&amp;"

Sorry, but this is not so.  Yes '&' is legal in the URL but it still needs
to be escaped when the URL appears in an HTML attribute as you have shown.

Please review

 Character references


<Prev in Thread] Current Thread [Next in Thread>