X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/02b9f69ba5da59cca9ff198b731d63d643fff4db..082f51fc6d8e9232cd97f9d3431272775ba093bc:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index c272a294e..37ff792d1 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -549,8 +549,14 @@ sub linkify ($$$) { #{{{ $content =~ s{(\\?)$config{wiki_link_regexp}}{ defined $2 - ? ( $1 ? "[[$2|$3]]" : htmllink($lpage, $page, linkpage($3), anchor => $4, linktext => pagetitle($2))) - : ( $1 ? "[[$3]]" : htmllink($lpage, $page, linkpage($3), anchor => $4)) + ? ( $1 + ? "[[$2|$3".(length $4 ? "#$4" : "")."]]" + : htmllink($lpage, $page, linkpage($3), + anchor => $4, linktext => pagetitle($2))) + : ( $1 + ? "[[$3".(length $4 ? "#$4" : "")."]]" + : htmllink($lpage, $page, linkpage($3), + anchor => $4)) }eg; return $content; @@ -1027,6 +1033,7 @@ sub match_link ($$$) { #{{{ my $links = $IkiWiki::links{$page} or return undef; return 0 unless @$links; my $bestlink = IkiWiki::bestlink($from, $link); + return 0 unless length $bestlink; foreach my $p (@$links) { return 1 if $bestlink eq IkiWiki::bestlink($page, $p); }