img: If a class is specified, don't also put the img in the img class.
[ikiwiki.git] / doc / bugs / class_parameter_of_img_directive_behave_not_as_documented.mdwn
1 On [[ikiwiki/directive/img/]] I read that
2
3 > You can also pass alt, title, class, align, id, hspace, and vspace
4 > parameters. These are passed through unchanged to the html img tag.
5
6 but when I pass `class="myclass"` to an img directive, I obtain
7
8     <img class="myclass img" ...
9
10 I found that this behaviour was added in commit f6db10d:
11
12 > img: Add a margin around images displayed by this directive.
13 >
14 > Particularly important for floating images, which could before be placed
15 > uncomfortably close to text.
16     
17 which adds to img.pm:
18     
19     if (exists $params{class}) {
20             $params{class}.=" img";
21     }
22     else {
23             $params{class}="img";
24     }
25
26 I would prefer if the `img` class were only added if no class attribute is
27 passed.
28
29 If you keep the current behaviour, please document it.
30
31 > [[done]] --[[Joey]]