aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/class_parameter_of_img_directive_behave_not_as_documented.mdwn
blob: e7797765f9903ca6c3b85090d32d9b03f1e28b06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
On [[ikiwiki/directive/img/]] I read that

> You can also pass alt, title, class, align, id, hspace, and vspace
> parameters. These are passed through unchanged to the html img tag.

but when I pass `class="myclass"` to an img directive, I obtain

    <img class="myclass img" ...

I found that this behaviour was added in commit f6db10d:

> img: Add a margin around images displayed by this directive.
>
> Particularly important for floating images, which could before be placed
> uncomfortably close to text.
    
which adds to img.pm:
    
    if (exists $params{class}) {
            $params{class}.=" img";
    }
    else {
            $params{class}="img";
    }

I would prefer if the `img` class were only added if no class attribute is
passed.

If you keep the current behaviour, please document it.

> [[done]] --[[Joey]]