]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
update
[git.ikiwiki.info.git] / IkiWiki.pm
index 0c1df8b474067375f6eb6d637a0250bf095a93fd..5ae360ad0ee32d3068a64a5e97cc742176dada4e 100644 (file)
@@ -39,7 +39,7 @@ sub defaultconfig () { #{{{
        wiki_link_regexp => qr{
                \[\[                    # beginning of link
                (?:
        wiki_link_regexp => qr{
                \[\[                    # beginning of link
                (?:
-                       ([^\]\|\n]+)    # 1: link text
+                       ([^\]\|\n\s]+)  # 1: link text
                        \|              # followed by '|'
                )?                      # optional
                
                        \|              # followed by '|'
                )?                      # optional
                
@@ -563,7 +563,7 @@ sub htmllink ($$$;@) { #{{{
 
                if (! $destsources{$bestlink}) {
                        return $linktext unless length $config{cgiurl};
 
                if (! $destsources{$bestlink}) {
                        return $linktext unless length $config{cgiurl};
-                       return "<span><a href=\"".
+                       return "<span class=\"createlink\"><a href=\"".
                                cgiurl(
                                        do => "create",
                                        page => pagetitle(lc($link), 1),
                                cgiurl(
                                        do => "create",
                                        page => pagetitle(lc($link), 1),
@@ -588,6 +588,9 @@ sub htmllink ($$$;@) { #{{{
        if (defined $opts{rel}) {
                push @attrs, ' rel="'.$opts{rel}.'"';
        }
        if (defined $opts{rel}) {
                push @attrs, ' rel="'.$opts{rel}.'"';
        }
+       if (defined $opts{class}) {
+               push @attrs, ' class="'.$opts{class}.'"';
+       }
 
        return "<a href=\"$bestlink\"@attrs>$linktext</a>";
 } #}}}
 
        return "<a href=\"$bestlink\"@attrs>$linktext</a>";
 } #}}}
@@ -823,6 +826,11 @@ sub enable_commit_hook () { #{{{
 } #}}}
 
 sub loadindex () { #{{{
 } #}}}
 
 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($_);
        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;
        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,
                },
                filename => $filename,
                loop_context_vars => 1,
@@ -1220,7 +1228,7 @@ sub match_link ($$;@) { #{{{
                                if $bestlink eq IkiWiki::bestlink($page, $p);
                }
                else {
                                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);
                }
        }
                                if match_glob($p, $link, %params);
                }
        }