3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-18 22:25:44 +01:00

Answer architecture round 1: one owner for the image's ADF shape, the readings' decision, marker paragraphs, the exceptions the README names; items 87 filed and 56 widened

This commit is contained in:
2026-10-09 03:37:29 +02:00
committed by Lillem4n
parent 8370230fee
commit 88aef1c8c4
14 changed files with 81 additions and 52 deletions
+10
View File
@@ -0,0 +1,10 @@
import type { AdfNode } from '../adf/document.ts'
// spec/flavour.md, The CommonMark image: the shape `![alt](url)` reads to, and the only one written back as it.
export function centeredImage(content: AdfNode[]): AdfNode {
return { attrs: { layout: 'center' }, content, type: 'mediaSingle' }
}
export function externalMedia(alt: string, url: string): AdfNode {
return { attrs: alt === '' ? { type: 'external', url } : { alt, type: 'external', url }, type: 'media' }
}