HomePhabricator

Introduce WikiLinkPrefixer
8de9bbc0e2c0Unpublished

Authored by thiemowmde on May 6 2019, 2:22 PM.

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Introduce WikiLinkPrefixer

Not all interwiki prefixes need the extra colon, only interlanguage
links do. At the moment this code does not care about this difference.
It does not even try to validate the given prefix. Therefor it must add
the colon every time. It doesn't hurt to do this, even if not needed.

Note this is missing code to find the matching interwiki prefix that
points from the target back to the source wiki. Code to do this already
exists, see InterwikiTablePrefixLookup, currently only used in
WikiRevisionFactory::prefixCommentLinks().

Bug: T198584
Change-Id: Iac67a9256da5cc60325918ead38cdcdc54f66b8b