From 672740a23ad0c86589893a56f77f69792613782e Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Mon, 11 Sep 2023 14:04:43 -0400 Subject: [PATCH] =?UTF-8?q?fix(core):=20=F0=9F=90=9B=20check=20for=20mw-he?= =?UTF-8?q?ading=20wrapper=20first=20before=20mw-parser-output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current implementation will fail with the new mw-heading wrapper --- includes/Partials/BodyContent.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/Partials/BodyContent.php b/includes/Partials/BodyContent.php index 35d61db4..031fa9ad 100644 --- a/includes/Partials/BodyContent.php +++ b/includes/Partials/BodyContent.php @@ -230,16 +230,14 @@ final class BodyContent extends Partial { $parentClasses = DOMCompat::getClassList( $parent ); - // Only target page headings, but not other heading tags - // TODO: Drop this when T13555 is deployed on LTS - if ( !$parentClasses->contains( 'mw-parser-output' ) ) { - continue; - } - // Use the `
` wrapper if it is present. When they are required // (T13555), the querySelectorAll() above can use the class and this can be removed. if ( $parentClasses->contains( 'mw-heading' ) ) { $el = $parent; + } else if ( !$parentClasses->contains( 'mw-parser-output' ) ) { + // Only target page headings, but not other heading tags + // TODO: Drop this when T13555 is deployed on LTS + continue; } // This check can be removed too when we require the wrappers.