]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
* Allow trailing slashes after page names in wikilinks.
[ikiwiki.git] / IkiWiki.pm
index 5ae360ad0ee32d3068a64a5e97cc742176dada4e..eb003a1fb9992e940dec64d2a315cca4260307c2 100644 (file)
@@ -498,13 +498,16 @@ sub abs2rel ($$) { #{{{
        return $ret;
 } #}}}
 
-sub displaytime ($) { #{{{
+sub displaytime ($;$) { #{{{
        my $time=shift;
+       my $format=shift;
+       if (! defined $format) {
+               $format=$config{timeformat};
+       }
 
        # strftime doesn't know about encodings, so make sure
        # its output is properly treated as utf8
-       return decode_utf8(POSIX::strftime(
-                       $config{timeformat}, localtime($time)));
+       return decode_utf8(POSIX::strftime($format, localtime($time)));
 } #}}}
 
 sub beautify_url ($) { #{{{
@@ -538,6 +541,7 @@ sub htmllink ($$$;@) { #{{{
        my $page=shift; # the page that will contain the link (different for inline)
        my $link=shift;
        my %opts=@_;
+       $link=~s/\/$//;
 
        my $bestlink;
        if (! $opts{forcesubpage}) {