summaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-02 00:37:22 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-02 00:37:22 +0000
commit3660b1c7a1757341024ceb267126ca63cd3c582a (patch)
tree02830c3a930fe61281898ef91650498753219548 /IkiWiki.pm
parent790fb348ae854a7e8a6e2ccd93df547dc15cd059 (diff)
* Allow for underscores to appear in page titles, if encoded appropriately
(__95__) in filenames. Previously, all underscores were replaced with spaces. Thanks, Enrico Zini for noticing that bug.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index dcb68bca6..62b54373b 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -365,20 +365,18 @@ sub pagetitle ($;$) { #{{{
my $unescaped=shift;
if ($unescaped) {
- $page=~s/__(\d+)__/chr($1)/eg;
+ $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
}
else {
- $page=~s/__(\d+)__/&#$1;/g;
+ $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : "&#$2;"/eg;
}
- $page=~y/_/ /;
return $page;
} #}}}
sub titlepage ($) { #{{{
my $title=shift;
- $title=~y/ /_/;
- $title=~s/([^-[:alnum:]_:+\/.])/"__".ord($1)."__"/eg;
+ $title=~s/([^-[:alnum:]:+\/.])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg;
return $title;
} #}}}