Thread:Project:Support desk/Possible (weird) bug with tags??

My setup:

Mediawiki: 1.23.5 PHP: 5.5.21 MYSQL:5.6.23

I'm seeing a weird bug with some custom tags that rely on parsing wikitext. The following example is a simplification (I'm just parsing a div tag) to highlight that the problem is related to the use of the parser:

class myClass{

public static function ExtensionSetupParserFunction( Parser$parser ) { $parser->setHook( 'mywiki-tag', 'self::ExtensionRenderParserFunction');

return true;

}

public static function ExtensionRenderParserFunction($input, array $args, Parser $parser, PPFrame $frame ) {

$wikiText=' '.$input.' ';
 * 1) simple div tag

$newParser=new Parser; $res=$newParser->parse($wikiText,$parser->getTitle,$parser->getOptions)->getText;
 * 1) let's parse it

return $res; }
 * 1) return


 * 1) end of class

}


 * 1) Now register the tag:

$wgHooks['ParserFirstCallInit'][] = 'myClass::ExtensionSetupParserFunction';

Now let's use this tag:

inputa input a

The html corresponding to the first line:

input a

The second line has an extra pre tag around 'a':

input a.

Any thoughts???