[pmwiki-devel] Custom markup to create a link followed by text
Randy Brown
randy at brownragfilms.com
Thu Jan 14 16:29:20 CST 2016
Thanks - that gets me closer. The problem now is that the markup isn’t interpreted.
I literally see "[-my ptv value-]” instead of a smaller font of “my ptv value”. Is there a way to get the text interpreted as markup?
Here’s what I’ve got:
Markup_e('[[|$', '<[[|',
"/(?>\\[\\[([^|\\]]+))\\|\\s*\\$\\s*]]/",
"Keep(MakeLink(\$pagename, \$m[1],
MyFunction(MakePageName(\$pagename,\$m[1]))
),'L').' [-'.PageTextVar(\$pagename,’MyPTV').'-]'");
function MyFunction ($pn) {
$title = PageVar($pn, '$Title');
return $title;
}
Randy
> On Jan 14, 2016, at 3:55 PM, Chuck Goldstein <cgpmw13 at codingmaniac.com> wrote:
>
> 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.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20160114/602e7276/attachment.html>
More information about the pmwiki-devel
mailing list