]> sipb.mit.edu Git - ikiwiki.git/commitdiff
img: Support hspace and vspace attributes.
authorJoey Hess <joey@kitenet.net>
Sat, 12 Jun 2010 20:16:24 +0000 (16:16 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 12 Jun 2010 20:43:24 +0000 (16:43 -0400)
IkiWiki/Plugin/img.pm
debian/changelog
doc/ikiwiki/directive/img.mdwn

index 48211454e93c1a65a5114241baccc207b1ac977b..a69175ba69bd78e5678f32bd1183d65e639b1c9d 100644 (file)
@@ -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;
index 4e120c62263c09c1097fec4c023ef62cd647b796..dcf58986144d0bc3f108190db54726a3f15c8f5d 100644 (file)
@@ -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
 
index 94cc754bd8dc5152bb638ec8957337ecc724c423..cda62b58f04cdad190f2b9a72b28546416185652 100644 (file)
@@ -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.