]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/img.pm
improve error message
[ikiwiki.git] / IkiWiki / Plugin / img.pm
index a697fea198d1ba7c2b386a704b3971ff30894a7a..44d67bd8375057e77d5853ee93cdd7943108ed14 100644 (file)
@@ -66,7 +66,7 @@ sub preprocess (@) {
 
        if ($params{size} ne 'full') {
                my ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/);
-               error sprintf(gettext('bad size "%s"'), $params{size})
+               error sprintf(gettext('wrong size format "%s" (should be WxH)'), $params{size})
                        unless (defined $w && defined $h &&
                                (length $w || length $h));
 
@@ -121,8 +121,9 @@ sub preprocess (@) {
        my $imgtag='<img src="'.$imgurl.
                '" width="'.$im->Get("width").
                '" height="'.$im->Get("height").'"'.
-               (exists $params{alt} ? '" alt="'.$params{alt}.'"' : '').
+               (exists $params{alt} ? ' alt="'.$params{alt}.'"' : '').
                (exists $params{title} ? ' title="'.$params{title}.'"' : '').
+               (exists $params{align} ? ' align="'.$params{align}.'"' : '').
                (exists $params{class} ? ' class="'.$params{class}.'"' : '').
                (exists $params{id} ? ' id="'.$params{id}.'"' : '').
                ' />';