summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2013-05-07 14:49:56 +0200
committerJan Holesovsky <kendy@suse.cz>2013-05-07 15:05:50 +0000
commitce4a33033e5b5e9f58bb9cf2c522afedaa9b1b3e (patch)
treef52b6d08a56723d19106f58b8256f15ed4f927b8
parentb56864919adc5b2c36b354e365c93964bb611dab (diff)
fdo#64211 replace / to %2F in HIDs for wiki redirects
Change-Id: I93780b76e17a3b833ef4ee6a50bb0969ab8bb01c Reviewed-on: https://gerrit.libreoffice.org/3811 Reviewed-by: Jan Holesovsky <kendy@suse.cz> Tested-by: Jan Holesovsky <kendy@suse.cz>
-rwxr-xr-xto-wiki/wikiconv2.py4
-rwxr-xr-xupload-wiki.pl1
2 files changed, 3 insertions, 2 deletions
diff --git a/to-wiki/wikiconv2.py b/to-wiki/wikiconv2.py
index 0e3bb5bf9..00d43d2c9 100755
--- a/to-wiki/wikiconv2.py
+++ b/to-wiki/wikiconv2.py
@@ -457,7 +457,7 @@ class Bookmark(ElementBase):
self.app = parser.current_app_raw
self.target = parser.wiki_page_name
self.authoritative = parser.follow_embed
- self.redirect = name
+ self.redirect = name.replace("/", "%2F")
def get_all(self):
global redirects
@@ -1359,7 +1359,7 @@ def write_link(r, target):
def write_redirects():
print 'Generating the redirects...'
written = {}
- # in the first pass, immediately writte the links that are embedded, so that
+ # in the first pass, immediately write the links that are embedded, so that
# we can always point to that source versions
for redir in redirects:
app = redir[0]
diff --git a/upload-wiki.pl b/upload-wiki.pl
index 1337900fd..13e2bc675 100755
--- a/upload-wiki.pl
+++ b/upload-wiki.pl
@@ -120,6 +120,7 @@ sub upload_article {
my $pagename = $File::Find::name;
$pagename =~ s/^wiki\///;
$pagename =~ s/\/MAIN$//;
+ $pagename =~ s/%2F/\//g;
# pages starting with lowercase 's' are redirects
if ( $pagename =~ /^s/ ) {