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

Answer architecture round 1: 2 🔴, 6 🟡 (0 misread); one escaping path refusing null characters, block writers returning their pieces, the HTML writer split, shared entry checks, lint between formats

This commit is contained in:
2026-10-23 14:51:15 +02:00
committed by Lillem4n
parent cc029b0bc9
commit e234905c27
19 changed files with 324 additions and 269 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
import type { AdfNode } from '../../adf/document.ts'
import type { WrittenFlavour } from '../flavour.ts'
import { plainImage } from '../../adf/external-image.ts'
import { targetDefinition } from '../mark-spellings.ts'
import { attrsDefinition } from '../mark-spellings.ts'
import { plainImage } from '../../adf/plain-image.ts'
import { tryImageLine } from './inline-line.ts'
export function tryImage(node: AdfNode, flavour: WrittenFlavour): string | undefined {
const image = plainImage(node)
if (image === undefined) return undefined
const { alt, link, url } = image
return tryImageLine(alt, url, flavour, link === undefined ? undefined : targetDefinition(link))
return tryImageLine(alt, url, flavour, link === undefined ? undefined : attrsDefinition(link))
}