aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-04-30 12:58:36 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-04-30 12:58:36 -0400
commitbb51e81762587364ae571b1f0a59955637e0e4a5 (patch)
treeecdb4fc6bbc69b1ba49cbcfcb4b8c7d47d8b9d56
parent112737535c023bf363c9d6be2377206417e4eebe (diff)
downloadikiwiki-bb51e81762587364ae571b1f0a59955637e0e4a5.tar
ikiwiki-bb51e81762587364ae571b1f0a59955637e0e4a5.tar.gz
img: Support a title attribute, will be passed through to html. Closes: #478718
-rw-r--r--IkiWiki/Plugin/img.pm3
-rw-r--r--debian/changelog2
-rw-r--r--doc/plugins/img.mdwn4
3 files changed, 7 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index b6e7c9e41..abc7e099a 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -22,11 +22,13 @@ sub preprocess (@) { #{{{
}
my $size = $params{size} || $imgdefaults{$params{page}}->{size} || 'full';
my $alt = $params{alt} || $imgdefaults{$params{page}}->{alt} || '';
+ my $title = $params{title} || $imgdefaults{$params{page}}->{title} || '';
if ($image eq 'defaults') {
$imgdefaults{$params{page}} = {
size => $size,
alt => $alt,
+ title => $title,
};
return '';
}
@@ -104,6 +106,7 @@ sub preprocess (@) { #{{{
my $imgtag='<img src="'.$imgurl.
'" alt="'.$alt.'" width="'.$im->Get("width").
'" height="'.$im->Get("height").'"'.
+ (defined $title ? ' title="'.$title.'"' : '').
(exists $params{class} ? ' class="'.$params{class}.'"' : '').
(exists $params{id} ? ' id="'.$params{id}.'"' : '').
' />';
diff --git a/debian/changelog b/debian/changelog
index 1c22e9faa..b7daeec27 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ ikiwiki (2.45) UNRELEASED; urgency=low
* Add PREFIX/bin to the hardcoded PATH within ikiwiki.
* Deal with different paths to perl when removing -T flag.
* Add missing de.po. Closes: #471540
+ * img: Support a title attribute, will be passed through to html.
+ Closes: #478718
-- Joey Hess <joeyh@debian.org> Sat, 26 Apr 2008 15:09:36 -0400
diff --git a/doc/plugins/img.mdwn b/doc/plugins/img.mdwn
index 06c8429c8..b5eef148f 100644
--- a/doc/plugins/img.mdwn
+++ b/doc/plugins/img.mdwn
@@ -23,8 +23,8 @@ The `size` parameter is optional, defaulting to full size. Note that the
original image's aspect ratio is always preserved, even if this means
making the image smaller than the specified size.
-You can also pass `alt`, `class` and `id` parameters. These are passed through
-unchanged to the html img tag.
+You can also pass `alt`, `title`, `class` and `id` parameters. These are
+passed through unchanged to the html img tag.
The `link` parameter is used to control whether the scaled down image links
to the full size version. By default it does; set "link=somepage" to link