diff options
author | Joey Hess <joey@kitenet.net> | 2010-07-05 14:04:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-07-05 14:04:49 -0400 |
commit | f6db10df21f04df83e109924647b07672050dbf3 (patch) | |
tree | a8fed8399efad1853b5c8a715b3c8f4fefc5aedc /IkiWiki | |
parent | 527c169ab2a6617138da2c4b817e452db65f80bf (diff) | |
download | ikiwiki-f6db10df21f04df83e109924647b07672050dbf3.tar ikiwiki-f6db10df21f04df83e109924647b07672050dbf3.tar.gz |
img: Add a margin around images displayed by this directive.
Particularly important for floating images, which could before be placed
uncomfortably close to text.
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/img.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index eb1b68124..2375ead89 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -156,6 +156,13 @@ sub preprocess (@) { $imgurl="$config{url}/$imglink"; } + if (exists $params{class}) { + $params{class}.=" img"; + } + else { + $params{class}="img"; + } + my $attrs=''; foreach my $attr (qw{alt title class id hspace vspace}) { if (exists $params{$attr}) { |