From 87d4d23737079030b9ccb146350b1db6f50fd1e9 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Sun, 10 Nov 2024 16:03:36 -0500 Subject: [PATCH] Use DOMCompat::getFirstElementChild() now that it is available from Parsoid There is only one child, so first/last element child are the same, but it's a little less confusing to use 'first' here. Follows-Up: Ifeb3b216e898bec1c3eb5917262820c5809fda45 Depends-On: I753bbbfaf99fb486384b0fa97de71159abb504b3 Change-Id: I65873c117cbd3e1d6efd82797c7b49bf707f5c3a --- src/Parsoid/ErrorUtils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Parsoid/ErrorUtils.php b/src/Parsoid/ErrorUtils.php index a07d9fd43..796a40a29 100644 --- a/src/Parsoid/ErrorUtils.php +++ b/src/Parsoid/ErrorUtils.php @@ -54,7 +54,7 @@ class ErrorUtils { ): DocumentFragment { $extApi->addTrackingCategory( 'cite-tracking-category-cite-error' ); $fragment = $extApi->createInterfaceI18nFragment( 'cite_error', [ $error ] ); - $fragSpan = DOMCompat::getLastElementChild( $fragment ); + $fragSpan = DOMCompat::getFirstElementChild( $fragment ); DOMUtils::addAttributes( $fragSpan, [ 'class' => 'error mw-ext-cite-error' ] ); return $fragment; }