[Mediawiki-l] help writing a parser function

Ittay Dror ittayd at qlusters.com
Mon Jan 1 06:11:51 UTC 2007


after much more digging, i think the text is processed, but preg_replace doesn't work.

printing the parameters (returning debug message enclosed in <nowiki>) and creating a test.php file with the same parameters works.

please help,
thanks,
ittay

Ittay Dror wrote:
> I'm trying to write a 'foreach' parser function. here is the code:
> public function foreach2Hook(&$parser, $text = '', $pattern = '', 
> $replacement = '', $insep = ',', $outsep = ',' ) {
>                $text= trim( $text );
>                $variables = explode(trim($insep), $text);
>                $return = preg_replace(trim($pattern), 
> trim($replacement), $variables);
>                return implode(trim($outsep), $return);
>        }  
> my problem is that (i think) $text contains unprocessed text. i want the 
> text after the wiki engine has gone over it, or, make it go over it 
> (giving me the resulting html)
> 
> thanks,
> ittay
> 


-- 
===================================
Ittay Dror, 
Chief architect, openQRM group leader, 
R&D, Qlusters Inc.
ittayd at qlusters.com
+972-3-6081994 Fax: +972-3-6081841

www.openqrm.org - Data Center Provisioning



More information about the MediaWiki-l mailing list