[pmwiki-users] Getting an URL from a cookbook recipe

Patrick R. Michaud pmichaud at pobox.com
Wed Jan 25 09:31:20 CST 2006


On Wed, Jan 25, 2006 at 04:17:42PM +0100, Dominique Faure wrote:
> I often need to catch urls from cookbook recipe's markup extensions,
> whatever form it could have (according to PmWiki syntax). For now, the
> easiest way I found to do that was to "regexp" clean the MakeLink
> function output:
> 
> Markup('mymarkup', 'directives',
>   "/\\(:mymarkup\\s+(.*)\\s*:\\)/e",
>   "MyMarkupFunc(\$pagename, PSS('$1'))");
> 
> function MyMarkupFunc($pagename, $target) {
>   $link = preg_replace("/.*href='([^']+)'.*/", '\1',
> MakeLink($pagename, $target, ''));
> 
>   # ...
> }
> 
> This working solution has several drawbacks, as for example not
> allowing to know if the given url needs approbation or not.
> 
> Any better idea would be appreciated.

I think I need a fuller description of what you're trying to
accomplish -- perhaps a more concrete example. 

Pm




More information about the pmwiki-users mailing list