Insert MathML content after tidy

* BeforeTidy caused problems when math tags were used
  within links.

Bug: T130508
Change-Id: Icb9b88a7552d14231f96cbfd2b3cf3fa7e29276d
This commit is contained in:
physikerwelt 2016-03-23 17:11:05 -04:00 committed by Physikerwelt
parent 010b04d641
commit 31cd0d611a
3 changed files with 12 additions and 3 deletions

View file

@ -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 */

View file

@ -69,8 +69,8 @@
"WikibaseRepoDataTypes": [
"MathWikidataHook::onWikibaseRepoDataTypes"
],
"ParserBeforeTidy":[
"MathHooks::onParserBeforeTidy"
"ParserAfterTidy":[
"MathHooks::onParserAfterTidy"
]
},
"config": {

View file

@ -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|<math forcemathmode="png">a+b</math>]]', $t, $po )->getText();
$this->assertContains( '</a>', $res );
$this->assertContains( '.png', $res );
}
}
/**