Render a README's badge row as badges !6

merged merged by cmc on 2026-08-31 23:17 UTC · krz/org-swift:badge-rows into main

Discussion

cmc

A paragraph holding nothing but images and image links is the badge row a README opens with. It became prose: OrgInlineStyler can only show an inline image's alt text, so [[…/builds][file:…/badge/build.svg]] rendered as the badge URL in italics.

Such a paragraph is now a .badges block — a row of images at their own size, each tapping through to its link. Natural size, not a figure: OrgBlockView's figure case is resizable().scaledToFit() with no cap, which would blow a 95x20 badge up to the column width.

Boundaries: a lone image on its own line stays a figure (a figure carries a caption and fills the column, right for a diagram); prose anywhere in the paragraph keeps it prose; an unresolvable source keeps it prose, since a badge row has no alt-text fallback to degrade to.

Images are requested at scale: 2, matching the 2x raster badges krz/gitbay!143 adds.

Seven tests in OrgBadgeRowTests cover both sides of each boundary.