aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2019-02-03 12:52:42 +0000
committerSimon McVittie <smcv@debian.org>2019-02-03 12:52:42 +0000
commit15ddbb1c70fecb052ef45ae96574a4d888578d11 (patch)
tree84300060886f245064b496dfb1d23a88335491cd
parentfae4cce06ab4b5adf7ca2a9e3f43ea2850a94148 (diff)
downloadikiwiki-15ddbb1c70fecb052ef45ae96574a4d888578d11.tar
ikiwiki-15ddbb1c70fecb052ef45ae96574a4d888578d11.tar.gz
trail: Allow unescaped punctuation in pagenames
By processing the pagenames through linkpage, we let users specify page names that contain non-alphanumerics in a more natural way. Signed-off-by: Simon McVittie <smcv@debian.org>
-rw-r--r--IkiWiki/Plugin/trail.pm2
-rwxr-xr-xt/trail.t3
2 files changed, 1 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/trail.pm b/IkiWiki/Plugin/trail.pm
index 476db4dcb..01e17d614 100644
--- a/IkiWiki/Plugin/trail.pm
+++ b/IkiWiki/Plugin/trail.pm
@@ -160,7 +160,7 @@ sub preprocess_trailitems (@) {
if (exists $params{pagenames}) {
push @{$pagestate{$params{page}}{trail}{contents}},
- [pagenames => (split ' ', $params{pagenames})];
+ [pagenames => (map { linkpage $_ } split ' ', $params{pagenames})];
}
return "";
diff --git a/t/trail.t b/t/trail.t
index d7edd52eb..125749f45 100755
--- a/t/trail.t
+++ b/t/trail.t
@@ -186,13 +186,10 @@ check_no_trail("snake.html", "wind_in_the_willows");
check_trail("self_referential.html", "n= p=", "self_referential");
-TODO: {
-local $TODO = 'should be able to specify page names without using numeric escapes';
check_trail("unicode/__172__.html", "n=unicode/\x{04D2} p=", "unicode");
check_trail("unicode/\x{04D2}.html", "n=unicode/__8800__ p=unicode/__172__", "unicode");
check_trail("unicode/__8800__.html", "n=unicode/__128169__ p=unicode/\x{04D2}", "unicode");
check_trail("unicode/__128169__.html", "n= p=unicode/__8800__", "unicode");
-}
check_trail("unicode/__172__.html", "n=unicode/\x{04D2} p=", "unicode2");
check_trail("unicode/\x{04D2}.html", "n=unicode/__8800__ p=unicode/__172__", "unicode2");