Handle SortKeyName and SortKey Template in Title

This commit is contained in:
2016-02-25 17:05:04 +01:00
parent 73bf26b627
commit b96c5d4a33

View File

@@ -278,6 +278,20 @@ missing!" )
for ref in self._titel_raw.ifilter_tags(matches="ref"): for ref in self._titel_raw.ifilter_tags(matches="ref"):
self._titel_raw.remove( ref ) self._titel_raw.remove( ref )
# Handle SortKeyName and SortKey
for template in self._titel_raw.ifilter_templates(
matches="SortKey" ):
if template.name == "SortKeyName":
titel = "[[" + template.get(1) + " " + template.get(2)
if template.has(3):
titel += "|" + template.get(3)
titel += "]]"
self._title_raw.replace( template, titel )
else:
if template.has(2):
self._title_raw.replace( template, template.get(2) )
# Remove whitespace # Remove whitespace
self._titel_raw = str(self._titel_raw).strip() self._titel_raw = str(self._titel_raw).strip()
else: else: