From: Joey Hess Date: Sat, 12 Jun 2010 20:16:24 +0000 (-0400) Subject: img: Support hspace and vspace attributes. X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/d7cfcef54a067221b801de17fafc1f05a13c2004 img: Support hspace and vspace attributes. --- 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=''.$params{alt}.''; 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 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.