Browse Source

Also canonicalise anchor parts of articles

Replace spaces in anchors with underscores as spaces are not correct
there

Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=114 FS#114]
develop
Jonathan Golder 7 years ago
parent
commit
0f930082b4
  1. 5
      lib/redfam.py

5
lib/redfam.py

@ -288,6 +288,11 @@ class RedFamParser( RedFam ):
article = article.split("#", 1)
# Replace underscores in title with spaces
article[0] = article[0].replace("_", " ")
if len(article) > 1:
# other way round, replace spaces with underscores in anchors
article[1] = article[1].replace(" ", "_")
# Rejoin title and anchor
article = "#".join(article)

Loading…
Cancel
Save