[Pmwiki-users] PmWiki 2 custom markup, draft 1

John Rankin john.rankin
Tue Sep 7 15:55:54 CDT 2004


On Tuesday, 7 September 2004 1:37 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>On Tue, Sep 07, 2004 at 10:11:59AM +1200, John Rankin wrote:
>> >[...]
>
>> ? So instead of writing
>> else
>>   Markup('breakpage','directives','/\\[:breakpage:\\]/','');
>> you could have written
>> else
>>   Markup('breakpage','directives','[:breakpage:]','');
>
>No, actually this last one wouldn't work...
>
>To use the non-pattern-match form to convert [:breakpage:] to an
>empty string, you'd need to do something like
>
>   Markup('breakpage','directives','[:breakpage:]',
>     "return str_replace('[:breakpage:]','',\$x);");
>
>Pm
>
This has been a very instructive and useful example. Thank you.

Just a couple of comments:

- for those browsers that strip trailing return characters from
  text in forms, perhaps the code could 
        explode('[:breakpage:]',$text."\n\n")

- if ($preview) it would be useful to render [:breakpage:] as
    "< div class='breaklist'>&mdash; Page Break &mdash;</div>"
  (for example) instead of ''

Thanks again.
-- 
JR
--
John Rankin





More information about the pmwiki-users mailing list