Re: TIDY doesn't handle asp scripts correctly...instead it misinterprets them

> > As it turns out, this was *not* what I meant.
> >
> > I think it hasn't anything to do with my problem.

> >
> > Mine is that a site URL inside the HTML
> >  <a href="http://www.bogus.com/script.asp?p1=1&p2=2&p3=3>
> >
> > results in a warning message
> >
> > line 1 column xx - Warning: unescaped & or unknown entity "&p2"
> > line 2 column yy - Warning: unescaped & or unknown entity "&p3"
> > The thing the thread far below is talking about is a different thing.

> Sorry for not being clearer.
>
> Strictly speaking (which we do when it comes to Tidy's output :)), if
> you want an ampersand character in an attribute such as href, you are
> supposed to write it as &amp; and not just &.  Writing ampersands this
> way is known as "escaping" the ampersand, hence Tidy's warning about an
> unescaped &.
>
> Tidy is saying that either a) you have an unescaped ampersand, which is
> true in your case, or b) you have an unknown entity named p2, which is
> not true in your case.  Tidy doesn't know which possibility is true, so
> it lists them both.)
>
> Browsers, on the other hand, are lax.  They let you write either &amp;
> or & to get an ampersand character.  However, without getting into a lot
> of detail, there are some potentially confusing cases where a plain &
> doesn't work as expected, so it's just as well that HTML has outlawed
> it.
>
> So Tidy is simply converting each unescaped & into &amp;
>
> Before Tidy (illegal href attribute):
>
[1]    <a href="http://www.bogus.com/script.asp?p1=1&p2=2&p3=3">
>
> After Tidy (legal href attribute):
>
[2]  <a href="http://www.bogus.com/script.asp?p1=1&amp;p2=2&amp;p3=3">
>

So I plead for Tidy to NOT bug with the ampersands in hrefs anyway!
I also dare to state that [1] is the normal way you see these hrefs in HTML
documents, [2] is *very* seldom seen imho.

I'm pushy, I know, but I don't have the will to change all my hrefs in my
pages just because Tidy can't be taught to leave these href's alone.
So I will live with that.
Everyone did it this way ever since, why should I change this?

I'm willing to use   &_a_m_p_;   (note strange format because I want to
prevent it from being converted) if I want to use ampersands in *texts* -
that's normal behavior. But no one would ever convince me to change all
ampersands in my asp calls to the above. This would be too much work -
resulting in nothing but satisfaction that Tidy doesn't output warnings
anymore.
But I won't go so far for this 'satisfaction'.

Andreas

Received on Tuesday, 22 August 2000 09:48:07 UTC