]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
img: Support a title attribute, will be passed through to html. Closes: #478718
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 30 Apr 2008 16:58:36 +0000 (12:58 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 30 Apr 2008 16:58:36 +0000 (12:58 -0400)
IkiWiki/Plugin/img.pm
debian/changelog
doc/plugins/img.mdwn

index b6e7c9e41db20db9639ec7927a2994a0560a799e..abc7e099ace54d78ef33f919ca1ebf6eaa2ad6ba 100644 (file)
@@ -22,11 +22,13 @@ sub preprocess (@) { #{{{
        }
        my $size = $params{size} || $imgdefaults{$params{page}}->{size} || 'full';
        my $alt = $params{alt} || $imgdefaults{$params{page}}->{alt} || '';
        }
        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,
 
        if ($image eq 'defaults') {
                $imgdefaults{$params{page}} = {
                        size => $size,
                        alt => $alt,
+                       title => $title,
                };
                return '';
        }
                };
                return '';
        }
@@ -104,6 +106,7 @@ sub preprocess (@) { #{{{
        my $imgtag='<img src="'.$imgurl.
                '" alt="'.$alt.'" width="'.$im->Get("width").
                '" height="'.$im->Get("height").'"'.
        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}.'"' : '').
                ' />';
                (exists $params{class} ? ' class="'.$params{class}.'"' : '').
                (exists $params{id} ? ' id="'.$params{id}.'"' : '').
                ' />';
index 1c22e9faa96cb260d48678d54cae341e8defb304..b7daeec27ca8d48bd0936eb3d6ba68bc23e6f9b1 100644 (file)
@@ -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
   * 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
 
 
  -- Joey Hess <joeyh@debian.org>  Sat, 26 Apr 2008 15:09:36 -0400
 
index 06c8429c8fff06e6f2b94ef1a9e7f93d655acbfb..b5eef148ffc6e75d3180c411337cfa9836c6592a 100644 (file)
@@ -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.
 
 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
 
 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