From 249e9d2b886a0ce807383a168a694453365558d2 Mon Sep 17 00:00:00 2001 From: Laurence Alexander Hurst Date: Wed, 4 Sep 2019 11:58:14 +0100 Subject: [PATCH] Convert page names and links to lowercase. This is instead of converting cAmElcase to c_am_elcase as the use of underscores breaks links if there is *any* inconsistency between case used in pagenames and links (but mediawiki lets you get away with it). --- dokuwiki.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dokuwiki.py b/dokuwiki.py index c56514a..37f3019 100644 --- a/dokuwiki.py +++ b/dokuwiki.py @@ -194,7 +194,11 @@ def make_dokuwiki_pagename(mediawiki_name): result = mediawiki_name.replace(" ","_") # We have pages that have ':' in them - replace with underscores result = result.replace(':', '_') - result = names.clean_id(camel_to_underscore(result)).replace("/",":") + # Inconsistent use to camel case and/or all lower means allowing + # converstion to camelcase breaks our wiki. + #result = names.clean_id(camel_to_underscore(result)).replace("/",":") + # Just convert everything to lowercase instead. It's safer. + result = names.clean_id(result.lower()).replace("/",":") # Some of our mediawiki page names begin with a '/', which results in os.path.join assuming the page is an absolute path. if result[0] == ':': result = result.lstrip(':')