Files
imccyu 700edb5ced fix(web): space consecutive Markdown images with CSS only (#9188)
* fix(web): space consecutive Markdown images with CSS only

An image paragraph (two or more previewable images and no other element)
gives each image half the paragraph gap above and below and cancels that
half at the paragraph edges with negative margins. Zero-width ::before and
::after boxes restore the edge gap when the first or last line is text, and
three sibling rules cover tables, blockquotes, and code blocks, whose
adjoining margins are below the paragraph gap.

* fix(web): cover adjacent image paragraphs, blockquote bars, and nested list items

Two adjacent image paragraphs collapsed their negative margins into one and
sat half a gap apart; the earlier one now keeps the half gap. A blockquote
that starts or ends with an image paragraph establishes its own formatting
context so its bar matches the images. Paragraphs in nested ordered lists
render inline, so they keep the plain inline layout.

* fix(web): keep blockquote bars and list-item gaps with image paragraphs

A blockquote no longer becomes a formatting root: only the side where an
image paragraph starts or ends it gets 1px of padding, so the other side's
heading, list, or code block margins still collapse outward and the bar
meets the images. The neighbor compensation now reads the paragraph gap of
its context (16px, 8px in list items), so image paragraphs in list items
keep master's distances to tables, code blocks, nested lists, and each
other while their rows stay 16px apart.

* fix(web): keep image paragraph margins inside list items

An image paragraph at the edge of a loose list item lost its negative margin
to the item's outer margins whenever another image paragraph sat across the
item boundary. List items now take the blockquote treatment: 1px of padding
on that side keeps the margin inside. The web e2e waits for every page image
before comparing media responses, and covers blockquote bars and adjacent
list items.

* fix(web): keep the gap after a blockquote that ends in a list or heading

A blockquote's last child margin collapses through it, so compensating on
the image paragraph after it double-counted a list's or heading's bottom
margin. The gap now goes on the blockquote's own bottom margin, which
collapses with whatever comes through, and the paragraph-gap variable is
declared per container (list items 8px, blockquotes 16px). The web e2e puts
an image paragraph right after a blockquote that ends in a list.

* docs(web): explain why an image paragraph splits its gap

The gap is split above and below each image because vertical-align: middle
centers an image's margin box on the line; a one-sided gap would shift a
same-line image by half the gap against the text beside it.
2026-11-26 16:58:35 +08:00
..