package main import ( "bytes" "context" ) // EditorialImageBlock overrides the built-in `image` block for the editorial // template. The image is wrapped in a
; the caption is rendered as // Source Serif italic 14px, preceded by a 1px hairline rule (UAT ยง13.12). // // Content shape: { "src", "alt", "caption" }. func EditorialImageBlock(ctx context.Context, content map[string]any) string { src := getString(content, "src") alt := getString(content, "alt") caption := getString(content, "caption") if src == "" { // Match built-in fallback: render nothing for an empty image. return "" } var buf bytes.Buffer _ = editorialImageComponent(src, alt, caption).Render(ctx, &buf) return buf.String() }