summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorGabriel McManus <gmcmanus@gmail.com>2008-07-07 21:33:01 +1000
committerJoey Hess <joey@gnu.kitenet.net>2009-01-21 21:17:57 -0500
commit950137eb6c4b5a75a01724736423e41ab3896e45 (patch)
treeb197c1f047543717de9b2d80e6a50483d39bb271 /IkiWiki/Plugin
parentb4bbddbf3e3d8f188f161098166fb4a27207ad2b (diff)
img: only provide alt text if it was specified
if suitable alternate text is unknown, then it should not be given. empty alt text is suitable mainly for purely decorative images. (cherry picked from commit 3cd7f67f0cf894f4fd5ba16f68e82e4f7bdbfdc5)
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/img.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index 5c580c03c..d295b833b 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -119,9 +119,9 @@ sub preprocess (@) {
}
my $imgtag='<img src="'.$imgurl.
- '" alt="'.(exists $params{alt} ? $params{alt} : '').
'" width="'.$im->Get("width").
'" height="'.$im->Get("height").'"'.
+ (exists $params{alt} ? '" alt="'.$params{alt}.'"' : '').
(exists $params{title} ? ' title="'.$params{title}.'"' : '').
(exists $params{class} ? ' class="'.$params{class}.'"' : '').
(exists $params{id} ? ' id="'.$params{id}.'"' : '').