The title, although it refers to a foreign page, is considered local
due to Title::isExternal() being false, hence it's namespace prefix
is localized.
We need to use the canonical namespace name instead.
Bug: T169221
Change-Id: I5e5f7d873b9497ca6c8853e7d8170a4f4f07c051
$link = Linker::makeExternalLink(
WikiMap::getForeignURL(
$wikiId,
- $title->getPrefixedText(),
+ $title->getNamespace() === 0
+ ? $title->getDBkey()
+ : MWNamespace::getCanonicalName( $title->getNamespace() ) . ':'
+ . $title->getDBkey(),
$title->getFragment()
),
$text,
'foo bar [[Special:BlankPage]]',
'enwiki',
],
+ [
+ 'foo bar <a class="external" rel="nofollow" href="//en.example.org/w/File:Example">Image:Example</a>',
+ 'foo bar [[Image:Example]]',
+ 'enwiki',
+ ],
];
// @codingStandardsIgnoreEnd
}