diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index b66031cc88..e1213971f6 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -486,7 +486,13 @@ class Parser { # with CSS (T37247) $class = $this->mOptions->getWrapOutputClass(); if ( $class !== false && !$this->mOptions->getInterfaceMessage() ) { - $text = Html::rawElement( 'div', [ 'class' => $class ], $text ); + # Enclose main body content with a
instead of a
. + # (T178398) + if ($class == "mw-parser-output") { + $test = Html::rawElement( 'main', null, $text ); + } else { + $text = Html::rawElement( 'div', [ 'class' => $class ], $text ); + } } $this->mOutput->setText( $text );