From: Joey Hess Date: Mon, 21 Jul 2008 20:53:52 +0000 (-0400) Subject: don't show an error if the image is missing, instead, a broken link X-Git-Tag: 2.55~88 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/97e21ae21caa2418015ae512755e8078a0bc5ccf?ds=sidebyside don't show an error if the image is missing, instead, a broken link --- diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 42de81bd1..748d28ace 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -42,8 +42,8 @@ sub preprocess (@) { #{{{ my $file = bestlink($params{page}, $image); my $srcfile = srcfile($file, 1); - if (! defined $srcfile) { - error(sprintf(gettext("%s not found"), $image)); + if (! length $file || ! defined $srcfile) { + return htmllink($params{page}, $params{destpage}, $image); } my $dir = $params{page};