From b3cfcdc25907fe016e1ca85c4de5bec8bba1d9a1 Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Sat, 2 Sep 2017 15:59:34 +0200 Subject: [PATCH] Improve title detection to get correct behaviour Make sure that categorie links are starting with colon and non article pages are returned with namespace. Related Task: [FS#154](https://fs.golderweb.de/index.php?do=details&task_id=154) --- bots/markpages.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bots/markpages.py b/bots/markpages.py index 00e33ba..d8e1545 100644 --- a/bots/markpages.py +++ b/bots/markpages.py @@ -187,7 +187,9 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat() save_ret = self.put_current( self.new_text, summary=summary ) # Normalize title with anchor (replace spaces in anchor) - article = self.current_page.title(withNamespace=False) + article = self.current_page.toggleTalkPage().title( + asLink=True, textlink=True) + article = article.strip("[]") article_parts = article.split("#", 1) if len(article_parts) == 2: article_parts[1] = article_parts[1].replace(" ", "_")