Remove special handling of math in sections

Originally this was added in T103269, but according
to T103269#6769990 this could not be needed anymore.
I've tested this with the original test case, and it
all works correctly without running the regex.

Change-Id: I5b3b11e71f0d6e55f158fa0d941977c823d12d51
This commit is contained in:
Petr Pchelko 2021-08-04 14:12:59 -07:00 committed by Physikerwelt
parent 25b3201324
commit a245040c20

View file

@ -157,12 +157,6 @@ class ParserHooksHandler implements
}
foreach ( $this->mathLazyRenderBatch as $key => [ $renderer, $renderParser ] ) {
$value = $this->mathPostTagHook( $renderer, $renderParser );
// Workaround for https://phabricator.wikimedia.org/T103269
$text = preg_replace(
'/(<mw:editsection[^>]*>.*?)' . preg_quote( $key ) . '(.*?)<\/mw:editsection>/',
'\1 $' . htmlspecialchars( $renderer->getTex() ) . '\2</mw:editsection>',
$text
);
$count = 0;
$text = str_replace( $key, $value, $text, $count );
if ( $count ) {