Remove workaround for T357812

Change-Id: I1aa3172c5656a79171351d0122f83b680adea739
This commit is contained in:
Bartosz Dziewoński 2024-02-17 04:05:13 +01:00
parent 0bf382329f
commit cc9524e268

View file

@ -181,20 +181,9 @@ abstract class ContentThreadItem implements JsonSerializable, ThreadItem {
public function getHTML(): string { public function getHTML(): string {
$fragment = $this->getRange()->cloneContents(); $fragment = $this->getRange()->cloneContents();
CommentModifier::unwrapFragment( $fragment ); CommentModifier::unwrapFragment( $fragment );
// Does not work: T357812 $editsection = DOMCompat::querySelector( $fragment, 'mw\\:editsection' );
// $editsection = DOMCompat::querySelector( $fragment, 'mw\\:editsection' ); if ( $editsection ) {
for ( $n = $fragment->firstChild; $n; $n = $n->nextSibling ) { $editsection->parentNode->removeChild( $editsection );
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;
}
}
} }
return DOMUtils::getFragmentInnerHTML( $fragment ); return DOMUtils::getFragmentInnerHTML( $fragment );
} }