Prevent lowercase article titles in Parser

Since real lowercase article titles are not allowed, make sure to
convert all first letters of article titles to uppercase. This is
neccessary since pywikibot will return article titles like this.

Related Task: [FS#157](https://fs.golderweb.de/index.php?do=details&task_id=157)
This commit is contained in:
2017-09-09 21:35:36 +02:00
parent d6f9b460c9
commit 02e53475f1

View File

@@ -284,6 +284,13 @@ class RedFamParser( RedFam ):
for link in heading.ifilter_wikilinks():
article = str( link.title ).strip()
# Short circuit empty links
if not article:
continue
# Make sure first letter is uppercase
article = article[0].upper() + article[1:]
# Split in title and anchor part
article = article.split("#", 1)
# Replace underscores in title with spaces