mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-19 22:55:44 +01:00
Answer architecture round 5: 0 🔴, 0 🟡 (0 misread); shownImage returns no textless state, item 143 and the card rule name their whole reach
This commit is contained in:
@@ -55,11 +55,11 @@ function shownPiece(node: AdfNode, lineFeed: string): string {
|
||||
return linkedText(node, shownText(node), shownUrl(node), lineFeed)
|
||||
}
|
||||
|
||||
// As portable markdown writes it inline, except that a link around a note stays (docs/decisions.md §The HTML dialect).
|
||||
// As portable markdown writes it inline, except that a link around a note stays and an image's own `text`, outside ADF's schema, shows first (docs/decisions.md §The HTML dialect).
|
||||
function linkedImage(media: AdfNode, lineFeed: string): string {
|
||||
const { after, link, text } = shownImage(media, shownLink(media)?.href)
|
||||
const shown = linkedText(media, text, link, lineFeed)
|
||||
return after === undefined ? shown : `${shown} (${linked('image', { href: after })})`
|
||||
const image = shownImage(media, shownLink(media)?.href)
|
||||
const shown = linkedText(media, image?.text, image?.link, lineFeed)
|
||||
return image?.after === undefined ? shown : `${shown} (${linked('image', { href: image.after })})`
|
||||
}
|
||||
|
||||
function linkedText(node: AdfNode, standIn: string | undefined, url: string | undefined, lineFeed: string): string {
|
||||
|
||||
Reference in New Issue
Block a user