From cc9524e26808bbb175b2a86d2df2e73abb1fefdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sat, 17 Feb 2024 04:05:13 +0100 Subject: [PATCH] Remove workaround for T357812 Change-Id: I1aa3172c5656a79171351d0122f83b680adea739 --- includes/ThreadItem/ContentThreadItem.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/includes/ThreadItem/ContentThreadItem.php b/includes/ThreadItem/ContentThreadItem.php index 814eb18cc..1490b6a74 100644 --- a/includes/ThreadItem/ContentThreadItem.php +++ b/includes/ThreadItem/ContentThreadItem.php @@ -181,20 +181,9 @@ abstract class ContentThreadItem implements JsonSerializable, ThreadItem { public function getHTML(): string { $fragment = $this->getRange()->cloneContents(); CommentModifier::unwrapFragment( $fragment ); - // Does not work: T357812 - // $editsection = DOMCompat::querySelector( $fragment, 'mw\\:editsection' ); - for ( $n = $fragment->firstChild; $n; $n = $n->nextSibling ) { - if ( $n instanceof Element ) { - if ( strtolower( $n->tagName ) === 'mw:editsection' ) { - $n->parentNode->removeChild( $n ); - break; - } - $editsection = DOMCompat::querySelector( $n, 'mw\\:editsection' ); - if ( $editsection ) { - $editsection->parentNode->removeChild( $editsection ); - break; - } - } + $editsection = DOMCompat::querySelector( $fragment, 'mw\\:editsection' ); + if ( $editsection ) { + $editsection->parentNode->removeChild( $editsection ); } return DOMUtils::getFragmentInnerHTML( $fragment ); }