X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/3d27dac8098957024b8e4c6ee815536fe81e8d18..46adbbd1c377b6c4a55c466e27de0bdce2fcb52c:/IkiWiki/Plugin/img.pm?ds=inline diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 68b001671..5f97e3810 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -135,11 +135,15 @@ sub preprocess (@) { elsif ($params{link} =~ /^\w+:\/\//) { $imgtag=''.$imgtag.''; } - elsif (length bestlink($params{page}, $params{link})) { - add_depends($params{page}, $params{link}); - $imgtag=htmllink($params{page}, $params{destpage}, - $params{link}, linktext => $imgtag, - noimageinline => 1); + else { + my $b = bestlink($params{page}, $params{link}); + + if (length $b) { + add_depends($params{page}, $b); + $imgtag=htmllink($params{page}, $params{destpage}, + $params{link}, linktext => $imgtag, + noimageinline => 1); + } } if (exists $params{caption}) {