[pmwiki-users] On the order of Markup

Petko Yotov 5ko at 5ko.fr
Wed May 3 12:48:46 CDT 2017


On 2017-05-03 19:19, Peter Kay wrote:
> One other problem I recently stumbled on is that the MarkupRules only
> allow one instance of a given pattern.
> 
> So for example if you want to process '/XXX/' twice (for whatever
> reason), you can't - only one copy goes in.


If you want to process '/XXX/' twice (for whatever reason), there are 
dozens of ways to write the same pattern:

   '/[X]XX/'
   '/X[X]X/'
   '/XX[X]/'
   '/(X)XX/'
   '/(XX)X/'
   '/(?:XX)X/'
   '/XXX{1}/'
   '/X{1}XX{1}/'

etc., etc., etc.

> I'd rather build the rules using the markup name, so as long
> as the names are different, they'll both run.

The next version of PHP, 7.2, will deprecate the function 
create_function(). We will have to rewrite the core markup engine, 
markup rules and the processing of various $*Patterns (future PmWiki 
versions may have to drop support for PHP 5.2 and older).

So indeed, it may be possible to find a way to build the rules using the 
markup name, and even pass the name to the processing function so a 
single function can do multiple rules.

As always, if implemented, such a feature will have to *not* break the 
existing markup rules that work today for PHP 5.3-7.1.

Petko



More information about the pmwiki-users mailing list