summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
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 /IkiWiki/Plugin
parent112737535c023bf363c9d6be2377206417e4eebe (diff)
img: Support a title attribute, will be passed through to html. Closes: #478718
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/img.pm3
1 files changed, 3 insertions, 0 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}.'"' : '').
' />';