From 0be6cdb08d30464a404b385cc6d28f19aadee8b6 Mon Sep 17 00:00:00 2001 From: physikerwelt Date: Wed, 24 Feb 2016 20:33:06 +0100 Subject: [PATCH] Use TeX representation for the editsection title Bug: T103269 Change-Id: I9ccb6653048e8d3c4574776690fab5574cb7030b --- Math.hooks.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Math.hooks.php b/Math.hooks.php index fb9623f..8b250e3 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -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( '/(]*>.*?)' . preg_quote( $key ) . + '(.*?)<\/mw:editsection>/', + '\1 $' . htmlspecialchars( $tag[0]->getTex() ) . '\2', $text ); $text = str_replace( $key, $value, $text ); } // This hook might be called multiple times. However one the tags are rendered the job is done.