summaryrefslogtreecommitdiff
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
parent9923f5db65f85485d10cb2b5a10c42bb36168de7 (diff)
img: Support hspace and vspace attributes.
-rw-r--r--IkiWiki/Plugin/img.pm12
-rw-r--r--debian/changelog1
-rw-r--r--doc/ikiwiki/directive/img.mdwn3
3 files changed, 11 insertions, 5 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;
diff --git a/debian/changelog b/debian/changelog
index 4e120c622..dcf589861 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low
* openid: Add openid_realm and openid_cgiurl configuration options,
useful in a few edge case setups.
* attachment: Show files from underlay in attachments list.
+ * img: Support hspace and vspace attributes.
-- Joey Hess <joeyh@debian.org> Fri, 11 Jun 2010 13:39:15 -0400
diff --git a/doc/ikiwiki/directive/img.mdwn b/doc/ikiwiki/directive/img.mdwn
index 94cc754bd..cda62b58f 100644
--- a/doc/ikiwiki/directive/img.mdwn
+++ b/doc/ikiwiki/directive/img.mdwn
@@ -18,7 +18,8 @@ making the image smaller than the specified size. You can also specify only
the width or the height, and the other value will be calculated based on
it: "200x", "x200"
-You can also pass `alt`, `title`, `class`, `align` and `id` parameters.
+You can also pass `alt`, `title`, `class`, `align`, `id`, `hspace`, and
+`vspace` parameters.
These are passed through unchanged to the html img tag. If you include a
`caption` parameter, the caption will be displayed centered beneath the image.