X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/2d9ee110063a7422a1bcfb97e14de2823c7a4733..80d16f80bf2e6a4edbef91d0f055e812537823d5:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 5ae360ad0..eb003a1fb 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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}) {