print '<figure>';
printf '<a href="/%s">', $inc =~ s/\.eng$//r;
if (my $table = eval { Data($inc) }) {
- printf '<img src="/%s" />', $_ for $table->{image} || ();
+ if (my $img = $table->{image}) {
+ EscapeHTML $name = $table->{imagealt} // $img =~ m{.*/([^/.]*)};
+ print qq{<img src="/$img" alt="$name" />};
+ }
$inc = $table->{title};
}
printf '<figcaption>%s</figcaption>', $inc;