On Oct 22, 2008, at 11:48 PM, bigga wrote:
> I must be dense - I can't find this solution anywhere: In BB 8.5, when
> selecting Inline > Anchor (cmd-ctrl-A) to generate a link. I paste a
> URL containing an ampersand, BBEdit thinks it needs to be converted to
> an entity.
>
> <http://www.domain.com/item_choose?keyword=whatever&sort=price>
>
> becomes
>
> <http://www.domain.com/item_choose?keyword=whatever&sort=price>
>
> Thereby wrecking the link.
>
> Digging in the preferences or the manual, there's not hint as to how
> to turn this "feature" off.
This feature cannot be turned off because it is both correct and
necessary.
When the URL is used as an attribute value, it must obey the rules of
HTML. Since & is the entity start char in HTML, it must be encoded as
& when it isn't being used as an entity start character.
Here's an example of why you need to do this. The trailing ; is
optional.
Suppose you have a URL
http:/www.example.com/someForm.cgi?mailto=jim©=YES
So you write HTML like this
<a href="http:/www.example.com/someForm.cgi?mailto=jim©=YES">Send
Mail</a>
Your browser will decode the entities, and send
http:/www.example.com/someForm.cgi?mailto=jim©=YES
By not encoding the &, you have "wrecked" the link.
When you encode as & your browser will decode the HTML attribute
value before constructing its request.
- Jim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or
confirmed) problem with the software, please email to "[EMAIL PROTECTED]"
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---