{#
IMAGE BLOCK — A single image, optionally linked and captioned.
Email-client notes baked into the markup below:
* The `width` ATTRIBUTE is what Outlook's Word engine honours; it
ignores CSS `max-width`. `max-width:100%` + `height:auto` then let
every other client scale the image down on a narrow screen.
* The same width is stated again as CSS, as a cap on `width:100%`: a
print engine maps no presentational hint, and a fixed CSS width would
widen a column narrower than it rather than shrink to fit (#201).
* The image is inline-block in a zero-leading line box, so `text-align`
places it and no descender gap opens under it; `border:0` kills the
blue border Outlook draws around a linked one.
* The caption sits outside the , so tapping it does not navigate.
Context:
subtitle — Optional sub-heading rendered above the image
image_src — Resolved src (hosted URL, cid: reference, or data: URI)
image_alt — Alt text; what the reader sees while images are blocked
image_width — Display width in px, or "" for full width
image_align — "left" | "center" | "right"
link_url — Optional href wrapping the image ("" for none)
caption — Optional caption rendered beneath the image, numbered
anchor — The figure's `id`, empty when it has none (#181)
disclosure — Compliance copy beneath the caption, from the partial
all three exhibits share
#}
{% from "common/notes.html" import marked with context %}
{% if subtitle %}
{{ subtitle | escape_html }}
|
{# Inline, in a zero-leading line box placed by text-align: a block image
ignores text-align, so a centred one sat at the left edge in every
client but Outlook, and WeasyPrint resolves margin:auto against
width:100% before the cap. The fix and its measurements are math.md's. #}
{% if caption %}
{{ marked(caption_parts) }} {% endif %} {% include "common/disclosure.html" %} |