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:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user