[pmwiki-users] Parentheses in URLs: proposed patch

Adrianna Pinska adrianna.pinska at gmail.com
Wed May 28 02:46:55 CDT 2008

Hi, everyone

I have installed pmwiki on my work intranet, and several users have
run into problems with the way it handles round brackets in URLs.  The
documents our users link to frequently have brackets in their names.
We have migrated many existing pages from another wiki, so there are
currently many broken links because of this issue.

I have been telling people to replace brackets with %28 and %29, but
given how frequently this issue occurs, and given that nobody here
really wants to use the round brackets for their intended purpose, I
would like to turn this markup off.

I searched through the mail archives and found a solution which now
seems to be obsolete.  After investigating the code, I believe that
this functionality is currently hard-coded into the MakeLink function.

I was thinking of writing a recipe for this, but it looks like the
only way to do that is to write a replacement MakeLink function and
then replace all relevant markup with markup which references the new
function -- which is messy and fragile.  So instead I'd like to submit
a patch to the MakeLink function to make this behaviour optional.

The patch is against trunk.  I have created a new global variable
which turns the special parentheses behaviour on and off -- the
default is on, as it is now.  To turn it off, the following lines need
to be put in the config file:

$UrlExcludeChars = '<>"{}|\\\\^`[\\]\'';
$AllowParenthesesInLinks = 1;

Ideally, I think $UrlExcludeChars should be changed automatically if
$AllowParenthesesInLinks is on -- is this possible?

Best regards,
Adrianna Pińska

~ Registered Linux User #334504 ~
"If ignorance is bliss, then knock the smile off my face."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parenthesesinlinks.patch
Type: text/x-patch
Size: 1359 bytes
Desc: not available
Url : http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20080528/c4d67c76/attachment.bin 

More information about the pmwiki-users mailing list