Merge "ParserOutputPostCacheTransform: Don't reprocess content"

This commit is contained in:
jenkins-bot 2023-11-21 15:56:14 +00:00 committed by Gerrit Code Review
commit 4f5a91ba52

View file

@ -86,6 +86,12 @@ class ParserHooks implements
* @inheritDoc
*/
public function onParserOutputPostCacheTransform( $parserOutput, &$text, &$options ): void {
if ( $parserOutput->getExtensionData( 'DiscussionTools-tocInfo' ) !== null ) {
// Since getText() could be called multiple times, return if we have
// already processed this ParserOutput object
return;
}
// NOTE: This is a temporary proxy for 'isPreview' flag in ParserOptions.
// It is not clear whether 'editsectionEditLinks' is disabled only for previews.
$isPreview = empty( $options['enableSectionEditLinks'] );