X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ffc0be87d7eca4de4dbc91d740d36b7b40bfa911..d9f1b1214926832793103adef926c0bccc833b48:/ikiwiki diff --git a/ikiwiki b/ikiwiki index c5ac7c0b8..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, @@ -242,7 +242,7 @@ sub bestlink ($$) { #{{{ sub isinlinableimage ($) { #{{{ my $file=shift; - $file=~/\.(png|gif|jpg|jpeg)$/; + $file=~/\.(png|gif|jpg|jpeg)$/i; } #}}} sub pagetitle ($) { #{{{ @@ -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;