X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/c72af182d87353cc520d29fe89e2cc91538b35bb..d9f1b1214926832793103adef926c0bccc833b48:/ikiwiki diff --git a/ikiwiki b/ikiwiki index f801df29e..9e9c29354 100755 --- a/ikiwiki +++ b/ikiwiki @@ -19,7 +19,7 @@ sub getconfig () { #{{{ if (! exists $ENV{WRAPPED_OPTIONS}) { %config=( wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$)}, - wiki_link_regexp => qr/\[\[([^\s\]]+)\]\]/, + wiki_link_regexp => qr/\[\[(?:([^\s\]\|]+)\|)?([^\s\]]+)\]\]/, wiki_processor_regexp => qr/\[\[(\w+)\s+([^\]]+)\]\]/, wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/, verbose => 0, @@ -252,11 +252,12 @@ sub pagetitle ($) { #{{{ return $page; } #}}} -sub htmllink ($$;$$) { #{{{ +sub htmllink ($$;$$$) { #{{{ my $page=shift; my $link=shift; my $noimageinline=shift; # don't turn links into inline html images my $forcesubpage=shift; # force a link to a subpage + my $linktext=shift; # set to force the link text to something my $bestlink; if (! $forcesubpage) { @@ -266,7 +267,7 @@ sub htmllink ($$;$$) { #{{{ $bestlink="$page/".lc($link); } - my $linktext=pagetitle(basename($link)); + $linktext=pagetitle(basename($link)) unless defined $linktext; return $linktext if length $bestlink && $page eq $bestlink;