Add a patch tag
[ikiwiki.git] / doc / bugs / img_with_alt_has_extra_double_quote.mdwn
1 The [[ikiwiki/directive/img]] directive emits an extra double quote if alt=x is
2 specified (as is necessary for valid HTML). This results in malformed HTML,
3 like this:
4
5     <img src="U" width="W" height="H"" alt="A" />
6                                      ^
7
8 This [[patch]] is available from the img-bugfix branch in my git repository:
9
10     commit a648c439f3467571374daf597e9b3a659ea2008f
11     Author: Simon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
12     Date:   2009-06-16 17:15:06 +0100
13     
14         img plugin: do not emit a redundant double-quote before alt attribute
15     
16     diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
17     index a697fea..a186abd 100644
18     --- a/IkiWiki/Plugin/img.pm
19     +++ b/IkiWiki/Plugin/img.pm
20     @@ -121,7 +121,7 @@ sub preprocess (@) {
21             my $imgtag='<img src="'.$imgurl.
22                     '" width="'.$im->Get("width").
23                     '" height="'.$im->Get("height").'"'.
24     -               (exists $params{alt} ? '" alt="'.$params{alt}.'"' : '').
25     +               (exists $params{alt} ? ' alt="'.$params{alt}.'"' : '').
26                     (exists $params{title} ? ' title="'.$params{title}.'"' : '').
27                     (exists $params{class} ? ' class="'.$params{class}.'"' : '').
28                     (exists $params{id} ? ' id="'.$params{id}.'"' : '').
29
30 --[[smcv]]
31
32 [[done]] --[[Joey]]