summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-06-12 16:16:24 -0400
committerJoey Hess <joey@kitenet.net>2010-06-12 16:43:24 -0400
commitd7cfcef54a067221b801de17fafc1f05a13c2004 (patch)
tree2a3269194db1314c31e1bba2a140c1a1aad9a166 /IkiWiki
parent9923f5db65f85485d10cb2b5a10c42bb36168de7 (diff)
img: Support hspace and vspace attributes.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/img.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index 48211454e..a69175ba6 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -156,14 +156,18 @@ sub preprocess (@) {
$imgurl="$config{url}/$imglink";
}
+ my $attrs='';
+ foreach my $attr (qw{alt title class id hspace vspace}) {
+ if (exists $params{$attr}) {
+ $attrs.=" $attr=\"$params{$attr}\"";
+ }
+ }
+
my $imgtag='<img src="'.$imgurl.
'" width="'.$dwidth.
'" height="'.$dheight.'"'.
- (exists $params{alt} ? ' alt="'.$params{alt}.'"' : '').
- (exists $params{title} ? ' title="'.$params{title}.'"' : '').
- (exists $params{class} ? ' class="'.$params{class}.'"' : '').
+ $attrs.
(exists $params{align} && ! exists $params{caption} ? ' align="'.$params{align}.'"' : '').
- (exists $params{id} ? ' id="'.$params{id}.'"' : '').
' />';
my $link;