emoji: prevent image enlargement (outside of figure elements)
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 28 May 2022 13:21:18 +0000 (15:21 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 1 Jun 2022 18:05:15 +0000 (20:05 +0200)
Accidentally scaled to full width since commit v1.12-0-g70012d8c59
(2020-05-06) [dieren: image figures captioned by names] not accounting
for these preexisting icons.

base.css
word/edit.plp

index cc3625f6efeeb34b071db322fc8d051c03df6582..f4a494397a55e6b5b3383f6ed4bcd53176171e92 100644 (file)
--- a/base.css
+++ b/base.css
@@ -677,7 +677,7 @@ figure {
        margin: 0;
        position: relative;
 }
-img {
+figure img {
        vertical-align: bottom;
        width: 100%;
 }
index 4a6daaad4a19ab503cd0680ec13479e11baa7934..2968642860ae37a31326c04f10d96a291744c7a9 100644 (file)
@@ -261,20 +261,20 @@ for my $col (@wordcols) {
        my ($attr, @span) = ref $info eq 'ARRAY' ? @{$info} : $info;
        next if delete $attr->{hidden} and not $row->{$col};
        my $title = ref $attr ? delete $attr->{-label} : $attr;
-       printf '<li><label for="%s">%s</label><p>', $col, $title;
+       printf '<li><label for="%s">%s</label><div>', $col, $title;
                printf '<span class=inline>';
                print $row->input($col => $attr);
                if (my $imgsrc = $attr->{-src}) {
                        my $hide = $col eq 'source';
-                       printf '<span id="%spreview">', $col unless $hide;
+                       printf '<figure id="%spreview">', $col unless $hide;
                        printf('<img src="/%s" alt="%s"%s />',
                                $_, $row->{form}, $hide && qq( id="${col}preview" hidden)
                        ) for grep { -e } $imgsrc->($row);
-                       printf '</span>' unless $hide;
+                       printf '</figure>' unless $hide;
                }
                print $row->input($_ => delete $wordcol{$_}) for @span;
                print '</span>';
-       say '</p></li>';
+       say '</div></li>';
 }
 
 if (not $row->{ref}) {