Having problems with strings in HTML

Sion Arrowsmith siona at chiark.greenend.org.uk
Tue Jun 27 11:57:43 EDT 2006


Richard Brodie <R.Brodie at rl.ac.uk> wrote:
>"Sion Arrowsmith" <siona at chiark.greenend.org.uk> wrote in message 
>news:gLB*BXekr at news.chiark.greenend.org.uk...
> [ ... ]
>>>By the way, you _do_ realize that your "&" characters should be escaped
>>>as "&", don't you?
>> No they shouldn't. They part of the url, which is (IIRC) a CDATA
>> attribute of the A element, not PCDATA.
>It is CDATA but ampersands still need to be escaped. 

I'll take back that "shouldn't" as per Fredrik's post. Maybe they
*should* be escaped, but they don't *need* to be. I've never, and
never seen, anyone doing that in a decade of writing cgi; a straw poll
of peers suggests that the majority would write the former; and I've
never encountred a browser getting tripped up by it. I suppose you
might need it if you've got parameters called quot or nbsp, but it's
hardly the most broken way of writing HTML.

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list