aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-07-15 19:00:07 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-07-15 19:00:07 +0000
commit3bd439fa03c13f19e7305b82fff23779e303154d (patch)
treea74585f88ceec529d62fef3f4c53169ae13515b8 /IkiWiki
parentf194e477c4a3fe43cdf28e43476fce34b0ae1ccf (diff)
downloadikiwiki-3bd439fa03c13f19e7305b82fff23779e303154d.tar
ikiwiki-3bd439fa03c13f19e7305b82fff23779e303154d.tar.gz
* In img tag, allow link=no to disable link to full size image. Thanks,
Nis Martensen. Closes: #433188
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/img.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index a453a49ba..c4e4a6f22 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -96,12 +96,19 @@ sub preprocess (@) { #{{{
return "[[img ".sprintf(gettext("failed to determine size of image %s"), $file)."]]";
}
- return '<a href="'.$fileurl.'"><img src="'.$imgurl.
+ my $imgtag='<img src="'.$imgurl.
'" alt="'.$alt.'" width="'.$im->Get("width").
'" height="'.$im->Get("height").'"'.
(exists $params{class} ? ' class="'.$params{class}.'"' : '').
(exists $params{id} ? ' id="'.$params{id}.'"' : '').
- ' /></a>';
+ ' />';
+
+ if (! defined $params{link} || lc($params{link}) eq 'yes') {
+ return '<a href="'.$fileurl.'">'.$imgtag.'</a>';
+ }
+ else {
+ return $imgtag;
+ }
} #}}}
1