diff --git a/Math.hooks.php b/Math.hooks.php index 57f75bf09..2fc6b5f6c 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -373,7 +373,7 @@ class MathHooks { * @param $text * @return bool */ - public static function onParserBeforeTidy( &$parser, &$text ) { + public static function onParserAfterTidy( &$parser, &$text ) { $rbis = array(); foreach ( self::$tags as $key => $tag ){ /** @var MathRenderer $renderer */ diff --git a/extension.json b/extension.json index 9db577296..75d1cdc1b 100644 --- a/extension.json +++ b/extension.json @@ -69,8 +69,8 @@ "WikibaseRepoDataTypes": [ "MathWikidataHook::onWikibaseRepoDataTypes" ], - "ParserBeforeTidy":[ - "MathHooks::onParserBeforeTidy" + "ParserAfterTidy":[ + "MathHooks::onParserAfterTidy" ] }, "config": { diff --git a/tests/MathMathMLTest.php b/tests/MathMathMLTest.php index ba730b853..3283da5b5 100644 --- a/tests/MathMathMLTest.php +++ b/tests/MathMathMLTest.php @@ -111,6 +111,15 @@ class MathMathMLTest extends MediaWikiTestCase { 'test if math expression is invalid mathml sample' ); } + public function testintegrationTestWithLinks() { + $p = new Parser(); + $po = new ParserOptions(); + $t = new Title( "test" ); + $res = $p->parse( '[[test|a+b]]', $t, $po )->getText(); + $this->assertContains( '', $res ); + $this->assertContains( '.png', $res ); + } + } /**