Physikerwelt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/273033
Change subject: Use TeX representation for the editsection title
......................................................................
Use TeX representation for the editsection title
Bug: T103269
Change-Id: I9ccb6653048e8d3c4574776690fab5574cb7030b
---
M Math.hooks.php
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math
refs/changes/33/273033/1
diff --git a/Math.hooks.php b/Math.hooks.php
index fb9623f..09ce9cf 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -385,7 +385,11 @@
MathRestbaseInterface::batchEvaluate( $rbis );
foreach ( self::$tags as $key => $tag ){
$value = call_user_func_array( array(
"MathHooks","mathPostTagHook" ), $tag );
- $text = str_replace( $key, $value, $text );
+ // Hack for https://phabricator.wikimedia.org/T103269
+ $text = preg_replace( '/(<mw:editsection page="(.*)"
section="(.*)">)(.*?)'
+ . preg_quote( $key ) .
'(.*?)<\/mw:editsection>/',
+ '\1 $' . htmlspecialchars( $tag[0]->getTex() )
. '\5</mw:editsection>', $text );
+ $text = str_replace( $key, $value, $text, $cnt );
}
// This hook might be called multiple times. However one the
tags are rendered the job is done.
self::$tags = array();
--
To view, visit https://gerrit.wikimedia.org/r/273033
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ccb6653048e8d3c4574776690fab5574cb7030b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits