diff --git a/lib/redfam.py b/lib/redfam.py index 6abb7ae..6c045c6 100644 --- a/lib/redfam.py +++ b/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)