aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/img.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2007-12-28 16:14:43 -0500
committerJoey Hess <joey@kitenet.net>2007-12-28 16:14:43 -0500
commitc2afda7f90c595d3256625c81aabc90252b7b07f (patch)
tree1e86e4983e7af8e0e8bb7068f745485962f75c3b /IkiWiki/Plugin/img.pm
parent633f8d4dd3f21e5793f4aa8f5b9ca91156a64034 (diff)
downloadikiwiki-c2afda7f90c595d3256625c81aabc90252b7b07f.tar
ikiwiki-c2afda7f90c595d3256625c81aabc90252b7b07f.tar.gz
* img: Allow the link parameter to point to an exterior url.
Diffstat (limited to 'IkiWiki/Plugin/img.pm')
-rw-r--r--IkiWiki/Plugin/img.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index 9385f6417..88a3d7b4d 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -106,7 +106,11 @@ sub preprocess (@) { #{{{
if (! defined $params{link} || lc($params{link}) eq 'yes') {
return '<a href="'.$fileurl.'">'.$imgtag.'</a>';
}
+ elsif ($params{link} =~ /^\w+:\/\//) {
+ return '<a href="'.$params{link}.'">'.$imgtag.'</a>';
+ }
elsif (length bestlink($params{page}, $params{link})) {
+ add_depends($params{page}, $params{link});
return htmllink($params{page}, $params{destpage},
$params{link}, linktext => $imgtag,
noimageinline => 1);