From 346f72d816ffa57890a80e7e843cfa1b282d3ea3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 3 Jun 2017 18:09:20 -0700 Subject: [PATCH] Wikifetch: fix lookup of articles with symbols (e.g. "/") in their title The normalization for the special cases was previously ignored if the query matched a "/"; why was this added in the first place? --- Wikifetch/plugin.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Wikifetch/plugin.py b/Wikifetch/plugin.py index a3e52d9..ac1c69e 100644 --- a/Wikifetch/plugin.py +++ b/Wikifetch/plugin.py @@ -77,13 +77,11 @@ class Wikifetch(callbacks.Plugin): # Different instances of MediaWiki use different URLs... This tries # to make the parser work for most sites, but still use resonable defaults # such as filling in http:// and appending /wiki to links... - # Special cases: Wikia, Wikipedia, Wikimedia (i.e. Wikimedia Commons), Arch Linux Wiki - if '/' not in query: - baseurl = baseurl.lower() - for match, suffix in self.SPECIAL_URLS.items(): - if match in baseurl: - baseurl += suffix - break + baseurl = baseurl.lower() + for match, suffix in self.SPECIAL_URLS.items(): + if match in baseurl: + baseurl += suffix + break # Add http:// to the URL if a scheme isn't specified if not baseurl.startswith(('http://', 'https://')):