X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/83618add817c1b405d67801d49b6937f0101bace..3ad33d9fde0efc5afeb776359420081a8daf34dd:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 8f9bd990a..52ae60d40 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".($4 ? "#$4" : "")."]]" + : htmllink($lpage, $page, linkpage($3), + anchor => $4, linktext => pagetitle($2))) + : ( $1 + ? "[[$3".($4 ? "#$4" : "")."]]" + : htmllink($lpage, $page, linkpage($3), + anchor => $4)) }eg; return $content;