Re: question on fix-uri config option

* Amit Narayanan wrote:
>I've a quick question on the fix-uri option of Tidy.
>It is my understanding that the fix-uri option is
>"yes" by default.  (Although I've set this option to
>"yes" in my config file)
>
>However, any html with an unescaped link, when passed
>through tidy with the above config, doesn't result in
>an escaped link in the final html.  For eg. the link
>I'm trying to escape using tidy is:´
>
>  http://www.something.org?onething=1&anotherthing=2&everything=1+2.
>
>The link arrives in the output html with the '&'
>character alone encoded with the html "&" .. and not
>its equivalent escaped url character "%26".

The ampersand character is allowed in URI References and often has a
special meaning, it's usually beeing used as separator between
parameters in the query part of a URI. If it's encoded using the %hh
encoding it loses this special meaning, i.e. your link is normally
interpreted as having three parameters

  onething     = 1
  anotherthing = 2
  everything   = 1+2

if you change it to

  http://www.something.org?onething=1%26anotherthing=2%26everything=1+2

it will be interpreted as having a single parameter

  onething     = 1&anotherthing=2&everything=1+2

If Tidy converted & to %26 most links will break, that's not the
intention of that option.

Received on Wednesday, 9 October 2002 17:40:39 UTC