[pmwiki-users] Linkformat with |

Patrick R. Michaud pmichaud at pobox.com
Sun Oct 9 09:16:50 CDT 2005


On Fri, Oct 07, 2005 at 09:26:47AM +0200, Laurent Meister wrote:
> Hello,
> 
> in our wiki, some Users want to make links to edonkey. I added the  
> ed2k:// to the Localmap so with [[edonkey:...]] they can link to the  
> edonkey files. But those Links have lot's of "|". Like"file| 
> filename.pdf|38745683647856|/". this doesn't work with pmwikis  
> Linkformat. anyone an idea?

Well, the problem is that although '|' is a valid character in
urls, PmWiki wants to use it as a separator for [[target | text]].
One solution is to encode any "|"'s in urls as %7c, although
that doesn't cut-and-paste very well.

The best solution might be to try to get PmWiki to do the conversion
itself -- try a rule like:

    Markup('edonkey:', '<links', 
      '/edonkey:\\S+/e',
      "str_replace('|', '%7c', '$0')");

which automatically converts any "|"'s following "edonkey:" into "%7c"
before the other link-handling rules pick it up.

Pm




More information about the pmwiki-users mailing list