]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
trail: Allow unescaped punctuation in pagenames
authorSimon McVittie <smcv@debian.org>
Sun, 3 Feb 2019 12:52:42 +0000 (12:52 +0000)
committerSimon McVittie <smcv@debian.org>
Sun, 3 Feb 2019 12:52:42 +0000 (12:52 +0000)
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>
IkiWiki/Plugin/trail.pm
t/trail.t

index 476db4dcb90130ce895c9480300ac84e12c482b1..01e17d61465e70de1c725eec20860e3b1a0e1478 100644 (file)
@@ -160,7 +160,7 @@ sub preprocess_trailitems (@) {
 
        if (exists $params{pagenames}) {
                push @{$pagestate{$params{page}}{trail}{contents}},
 
        if (exists $params{pagenames}) {
                push @{$pagestate{$params{page}}{trail}{contents}},
-                       [pagenames => (split ' ', $params{pagenames})];
+                       [pagenames => (map { linkpage $_ } split ' ', $params{pagenames})];
        }
 
        return "";
        }
 
        return "";
index d7edd52eb59ea1cb81c84cf2e157d4bdbac884b8..125749f450178e6414d3bfef3f4ada893b4bcf94 100755 (executable)
--- 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");
 
 
 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=", "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");
 
 check_trail("unicode/__172__.html", "n=unicode/\x{04D2} p=", "unicode2");
 check_trail("unicode/\x{04D2}.html", "n=unicode/__8800__ p=unicode/__172__", "unicode2");