diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php index 17ad20a1..5b7ea54a 100644 --- a/SyntaxHighlight_GeSHi.class.php +++ b/SyntaxHighlight_GeSHi.class.php @@ -378,6 +378,24 @@ class SyntaxHighlight_GeSHi { return false; } + /** + * Reject parser cache values that are for GeSHi since those + * ResourceLoader modules no longer exist + * + * @param ParserOutput $parserOutput + * @param WikiPage $page + * @param ParserOptions $popts + * @return bool + */ + public static function onRejectParserCacheValue( ParserOutput $parserOutput, WikiPage $page, ParserOptions $popts ) { + foreach ( $parserOutput->getModuleStyles() as $module ) { + if ( strpos( $module, 'ext.geshi.' ) === 0 ) { + return false; + } + } + return true; + } + /** Backward-compatibility shim for extensions. */ public static function prepare( $text, $lang ) { wfDeprecated( __METHOD__ ); diff --git a/extension.json b/extension.json index b589486c..f2d238d8 100644 --- a/extension.json +++ b/extension.json @@ -50,6 +50,9 @@ ], "ApiFormatHighlight": [ "SyntaxHighlight_GeSHi::onApiFormatHighlight" + ], + "RejectParserCacheValue": [ + "SyntaxHighlight_GeSHi::onRejectParserCacheValue" ] }, "SyntaxHighlightModels": {