mediawiki.Title: Remove dead code and streamline newFromUserInput()
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Mon, 13 May 2019 08:57:01 +0000 (10:57 +0200)
committerKrinkle <krinklemail@gmail.com>
Mon, 13 May 2019 18:11:01 +0000 (18:11 +0000)
commit8b13b98624722df300caa32c7e54b1315312706a
tree74dae56b5afa5aa1434ad73fa72e2a1156b6bacf
parent38962766742bd4319027f8f8da5a7f908de05eed
mediawiki.Title: Remove dead code and streamline newFromUserInput()

This patch also does:
* Fix the behavior for filenames that have a dot, but no file
  extension after the dot.
* Add missing test cases.

It seems like this method is barely used anywhere:
https://codesearch.wmflabs.org/search/?q=newFromUserInput&i=1

So we might as well remove it, and inline simplified versions that
only do exactly the normalizations that are needed. For example,
silently stripping leading colons is a somewhat suprising thing to
do. Shouldn't such a title be invalid, instead of silently being
converted to something else? But this is unrelated to what this
patch does.

Change-Id: I1596fb0d9d02ca230a37f3d70d65296d6ce4ddb4
resources/src/mediawiki.Title/Title.js
tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js