From 4d19d19f1db9621479b68d94fd3db2467e32983b Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Thu, 15 Feb 2024 21:15:03 -0500 Subject: [PATCH] Fix matching external link rel Introduced in I8d7bdf1bccc869b4dc17058a5822ef34968471e6 Change-Id: I52a8a993fbdd4058d40f4aeac3df37e90e686f3e --- includes/ParsoidImageMap.php | 2 +- tests/parser/imageMapParserTests.txt | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/includes/ParsoidImageMap.php b/includes/ParsoidImageMap.php index 659ceef..7ad4a02 100644 --- a/includes/ParsoidImageMap.php +++ b/includes/ParsoidImageMap.php @@ -207,7 +207,7 @@ class ParsoidImageMap extends ExtensionTagHandler implements ExtensionModule { DOMUtils::assertElt( $a ); $href = $a->getAttribute( 'href' ); - $externLink = DOMUtils::matchRel( $a, '#^mw:ExtLink/#D' ) !== null; + $externLink = DOMUtils::matchRel( $a, '#^mw:ExtLink#D' ) !== null; $alt = ''; $hasContent = $externLink || ( DOMDataUtils::getDataParsoid( $a )->stx ?? null ) === 'piped'; diff --git a/tests/parser/imageMapParserTests.txt b/tests/parser/imageMapParserTests.txt index 2d28eda..996cbaa 100644 --- a/tests/parser/imageMapParserTests.txt +++ b/tests/parser/imageMapParserTests.txt @@ -334,3 +334,18 @@ Foobar.jpg !! html/parsoid-disabled

imagemap_no_image

!! end + +!! test +Imagemap with external link +!! config +wgParserEnableLegacyMediaDOM=false +!! wikitext + +File:Foobar.jpg +default [http://google.com] + +!! html/php +
+!! html/parsoid +
+!! end