[pmwiki-devel] Custom markup to create a link followed by text

Chuck Goldstein cgpmw13 at codingmaniac.com
Thu Jan 14 15:55:20 CST 2016


You probably want to move the $:MyPTV code from your function to outside the Keep function. 

Chuck G



-------- Original Message --------
From: Randy Brown <randy at brownragfilms.com>
Sent: January 14, 2016 3:36:48 PM CST
To: Chuck G <cgpmw13 at codingmaniac.com>
Cc: pmwiki-devel at pmichaud.com
Subject: Re: [pmwiki-devel] Custom markup to create a link followed by text

Thanks for responding. 

I get the expected result from the following code, but it’s not quite what I want to achieve:

Markup_e('[[|$', '<[[|',
   "/(?>\\[\\[([^|\\]]+))\\|\\s*\\$\\s*]]/", 
   "Keep(MakeLink(\$pagename, \$m[1],
     MyFunction(MakePageName(\$pagename,\$m[1]))
     ),'L')"); 

function MyFunction($pn) {
    $title = PageVar($pn, '$Title');
    return $title.'[-'.PageTextVar($pn,’MyPTV').'-]';
}

Unfortunately, the above makes $:MyPTV and the sounding brackets all appear as link text. I want everything after the $Title to appear as markup AFTER the link.

How would I accomplish that?

Randy


> On Jan 14, 2016, at 12:45 PM, Chuck G <cgpmw13 at codingmaniac.com> wrote:
> 
> Not sure if this is a problem, but I notice that some of your
> quotes and approstophes are oblique versions. You might try
> setting your program editor charset to ascii.
> 





More information about the pmwiki-devel mailing list