diff --git a/src/wikiq/__init__.py b/src/wikiq/__init__.py index 9d3cb7a..5a6728f 100755 --- a/src/wikiq/__init__.py +++ b/src/wikiq/__init__.py @@ -385,8 +385,12 @@ class WikiqPage: # page.namespace is inconsistent with namespace_map if page.namespace not in namespace_map: page.namespace = 0 + # mwxml >= 0.3.7 keeps the namespace prefix on the title when the dump + # has tags, but strips it on the no- fallback path if page.namespace != 0: - page.title = ":".join([namespace_map[page.namespace], page.title]) + ns_prefix = namespace_map[page.namespace] + ":" + if not page.title.startswith(ns_prefix): + page.title = ns_prefix + page.title self.restrictions = page.restrictions self.collapse_user = collapse_user self.mwpage = page