aboutsummaryrefslogtreecommitdiffstats
path: root/includes/content/JavaScriptContentHandler.php
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@cscott.net>2023-11-15 13:05:51 -0500
committerC. Scott Ananian <cscott@cscott.net>2024-02-05 17:01:44 -0500
commit0196c8a5d8d3e1a5ae355b0984afb1798703a18b (patch)
tree7957a861c95e7bfdfc16bacc71c6252979ec899b /includes/content/JavaScriptContentHandler.php
parentefc5e3b5ef914ca86788e0b41da2ac314266059d (diff)
downloadmediawikicore-0196c8a5d8d3e1a5ae355b0984afb1798703a18b.tar.gz
mediawikicore-0196c8a5d8d3e1a5ae355b0984afb1798703a18b.zip
WikiPage: remove ::suppressTOC hack
Instead of overriding the ParserOptions for the page, just clear the section data and set the NO_TOC flag in the resulting ParserOutput. Bug: T307691 Bug: T350626 Change-Id: I6a24edcc5eb5bed50adcfb8648b953afa54ac0f6
Diffstat (limited to 'includes/content/JavaScriptContentHandler.php')
-rw-r--r--includes/content/JavaScriptContentHandler.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/content/JavaScriptContentHandler.php b/includes/content/JavaScriptContentHandler.php
index 4efd60f16b31..db47bd01d7d2 100644
--- a/includes/content/JavaScriptContentHandler.php
+++ b/includes/content/JavaScriptContentHandler.php
@@ -24,6 +24,7 @@ use MediaWiki\Html\Html;
use MediaWiki\MainConfigNames;
use MediaWiki\MediaWikiServices;
use MediaWiki\Parser\ParserOutput;
+use MediaWiki\Parser\ParserOutputFlags;
use MediaWiki\Title\Title;
/**
@@ -155,5 +156,8 @@ class JavaScriptContentHandler extends CodeContentHandler {
$output->clearWrapperDivClass();
$output->setText( $html );
+ // Suppress the TOC (T307691)
+ $output->setOutputFlag( ParserOutputFlags::NO_TOC );
+ $output->setSections( [] );
}
}