mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-12-18 18:40:39 +00:00
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:
parent
010b04d641
commit
31cd0d611a
|
@ -373,7 +373,7 @@ class MathHooks {
|
||||||
* @param $text
|
* @param $text
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function onParserBeforeTidy( &$parser, &$text ) {
|
public static function onParserAfterTidy( &$parser, &$text ) {
|
||||||
$rbis = array();
|
$rbis = array();
|
||||||
foreach ( self::$tags as $key => $tag ){
|
foreach ( self::$tags as $key => $tag ){
|
||||||
/** @var MathRenderer $renderer */
|
/** @var MathRenderer $renderer */
|
||||||
|
|
|
@ -69,8 +69,8 @@
|
||||||
"WikibaseRepoDataTypes": [
|
"WikibaseRepoDataTypes": [
|
||||||
"MathWikidataHook::onWikibaseRepoDataTypes"
|
"MathWikidataHook::onWikibaseRepoDataTypes"
|
||||||
],
|
],
|
||||||
"ParserBeforeTidy":[
|
"ParserAfterTidy":[
|
||||||
"MathHooks::onParserBeforeTidy"
|
"MathHooks::onParserAfterTidy"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
|
|
@ -111,6 +111,15 @@ class MathMathMLTest extends MediaWikiTestCase {
|
||||||
'test if math expression is invalid mathml sample' );
|
'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 );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue