> Otherwise a link markup like [[test.a&b]] may be useful for writing
> amps and other entities as htmlcharactercodes in links.

I found one solution to do this:
add the following markup rule in markup.php before
MarkUp('pre', 'entities', ...) :

MarkUp('pre', 'ampamp', '/&/', '%26');

Dan, I noticed that you has removed the ampamp rule I originally
suggested, no doubt thinking it is redundant and covered by the
following 'entities' rule.

But the new rule I suggest may be useful, as it converts an explicit
'&' into url code.
this translates cases like [[test.a&b]] into correct link 'test.a%26b'
while it leaves cases like [[xyz&action=edit] intact.

I don't know if the 'ampamp' rule above has negative implications
elsewhere, but it seems to behave on first check.

It will allow links with html character codes like [[test.a—b]].
If one creates a page following that link, the page saves as 'test.a%e2%80%94b',
which is altogether better than test.a%26mdash%3Bb.
'test.a%e2%80%94b' resolves in the url bat as ?p=test.a—b
whereas test.a%26mdash%3Bb does not resolve a mdash character.

I think I am on the right track here.
But how can we achieve that htmlspecialcharacter input in the name
field of a 'create new page' form will be urlencoded correctly? We
need to decode  htmlentities first, before urlencoding. BOLTfilter()
is called from BOLTsavepage() to manipulate the page name, and it
calls BOLTutf2url(). I tried adding there $x = html_entity_decode($x);
before $x = urlencode($x);, but the html_entity_decode keeps failing
me, not sure why!

@Martin: I do not see that a url encoded & will give trouble with GET,
i.e. mess up non-encoded & arg separators.

~Hans

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" 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/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to