X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/99261148fe12255b5825a4d07d754424ee876c78..65d56aa012d7e241140e109176783ea0d23778bd:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 0c1df8b47..7a189cc8b 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -39,7 +39,7 @@ sub defaultconfig () { #{{{ wiki_link_regexp => qr{ \[\[ # beginning of link (?: - ([^\]\|\n]+) # 1: link text + ([^\]\|\n\s]+) # 1: link text \| # followed by '|' )? # optional @@ -588,6 +588,9 @@ sub htmllink ($$$;@) { #{{{ if (defined $opts{rel}) { push @attrs, ' rel="'.$opts{rel}.'"'; } + if (defined $opts{class}) { + push @attrs, ' class="'.$opts{class}.'"'; + } return "$linktext"; } #}}} @@ -823,6 +826,11 @@ sub enable_commit_hook () { #{{{ } #}}} sub loadindex () { #{{{ + %oldrenderedfiles=%pagectime=(); + if (! $config{rebuild}) { + %pagesources=%pagemtime=%oldlinks=%links=%depends= + %destsources=%renderedfiles=%pagecase=(); + } open (my $in, "<", "$config{wikistatedir}/index") || return; while (<$in>) { $_=possibly_foolish_untaint($_); @@ -903,7 +911,7 @@ sub template_params (@) { #{{{ my @ret=( filter => sub { my $text_ref = shift; - ${$text_ref} = Encode::decode_utf8(${$text_ref}); + ${$text_ref} = decode_utf8(${$text_ref}); }, filename => $filename, loop_context_vars => 1, @@ -1220,7 +1228,7 @@ sub match_link ($$;@) { #{{{ if $bestlink eq IkiWiki::bestlink($page, $p); } else { - return IkiWiki::SuccessReason->new("$page links to page matching $link") + return IkiWiki::SuccessReason->new("$page links to page $p matching $link") if match_glob($p, $link, %params); } }