Introduce WikiLinkParser

Authored by thiemowmde on May 3 2019, 2:36 PM.


Introduce WikiLinkParser

This class uses the visitor pattern. We know we need at least two steps
when we want to clean wiki links:

  • De-localize namespace names.
  • Add the interwiki prefix to point back to the source wiki, depending on the namespace.

We are not sure yet what the order of these steps should be. The visitor
pattern is not only good for performance reasons (no need to parse the
wikitext two times), it allows to easily change the order any time.

Bug: T198584
Bug: T213821
Change-Id: I34a6b388242c01eee4c8fe0e529a5a84a057ae62