From d589e6dea5da314055461ddadff374f887f4bee4 Mon Sep 17 00:00:00 2001 From: Vedmaka Date: Fri, 26 May 2023 15:31:39 +0400 Subject: [PATCH] Update HeaderFooter.class.php Prevent duplicated `mw-parser-output` element from appearing --- HeaderFooter.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HeaderFooter.class.php b/HeaderFooter.class.php index 611e348..2303822 100644 --- a/HeaderFooter.class.php +++ b/HeaderFooter.class.php @@ -19,7 +19,9 @@ public static function hOutputPageParserOutput( &$op, $parserOutput ) { $ns = $wgTitle->getNsText(); $name = $wgTitle->getPrefixedDBKey(); - $text = $parserOutput->getText(); + // Get output markup omitting the `mw-parser-output` wrapper + // because the wrapper will be added later by $parserOutput->setText + $text = $parserOutput->getText( [ 'wrapperDivClass' => '' ] ); $nsheader = self::conditionalInclude( $text, '__NONSHEADER__', 'hf-nsheader', $ns ); $header = self::conditionalInclude( $text, '__NOHEADER__', 'hf-header', $name );