Use TeX representation for the editsection title

Bug: T103269
Change-Id: I9ccb6653048e8d3c4574776690fab5574cb7030b
This commit is contained in:
physikerwelt 2016-02-24 20:33:06 +01:00
parent 7018e85b7d
commit 0be6cdb08d
1 changed files with 4 additions and 0 deletions

View File

@ -385,6 +385,10 @@ class MathHooks {
MathRestbaseInterface::batchEvaluate( $rbis );
foreach ( self::$tags as $key => $tag ){
$value = call_user_func_array( array( "MathHooks","mathPostTagHook" ), $tag );
// Workaround for https://phabricator.wikimedia.org/T103269
$text = preg_replace( '/(<mw:editsection[^>]*>.*?)' . preg_quote( $key ) .
'(.*?)<\/mw:editsection>/',
'\1 $' . htmlspecialchars( $tag[0]->getTex() ) . '\2</mw:editsection>', $text );
$text = str_replace( $key, $value, $text );
}
// This hook might be called multiple times. However one the tags are rendered the job is done.