summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-24 12:36:10 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-24 12:36:10 -0400
commitc2f621cb1c2eb8bb898acfbfac059c5ee2d9568e (patch)
treea07dccd932d71b5a4d240cddf2dd441907b41ee8 /IkiWiki
parent8b3d2ab0bcd5b79c30d6e07dd8f363431d94dd72 (diff)
fix encoding issues with link conversion
Have to convert link text to page name going in. And on the way out, need to replace spaces with underscores in the link text, which is not normally done with titles.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/link.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm
index 529610710..2ea6aa19e 100644
--- a/IkiWiki/Plugin/link.pm
+++ b/IkiWiki/Plugin/link.pm
@@ -90,8 +90,9 @@ sub renamepage (@) { #{{{
$params{content} =~ s{(?<!\\)$link_regexp}{
my $linktext=$2;
my $link=$linktext;
- if (bestlink($page, $2) eq $old) {
+ if (bestlink($page, IkiWiki::linkpage($linktext)) eq $old) {
$link=IkiWiki::pagetitle($new, 1);
+ $link=~s/ /_/g;
if ($linktext =~ m/.*\/*?[A-Z]/) {
# preserve leading cap of last component
my @bits=split("/", $link);