3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-13 04:08:29 +01:00

Answer prose round 1: 0 🔴, 2 🟡 (0 misread); say a note keeps only its link and reword the note comments

This commit is contained in:
2026-11-09 09:21:15 +01:00
committed by Lillem4n
parent 2aa246898d
commit 896e67fdfd
4 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ export function oneLine(text: string): string {
export type ShownNote = { link: LinkAttrs | undefined; name: string }
// The note standing in place of a node that shows no text of its own: `name` what it references, and `link` the node's link, which both writers keep around the note. `undefined` where the node references nothing.
// The note standing in place of a node that shows no text of its own: `name` is what the node references, `link` its own link, kept around the note. `undefined` where the node references nothing.
export function shownNote(node: AdfNode): ShownNote | undefined {
const name = referenceName(node)
return name === undefined ? undefined : { link: shownLink(node), name }
+1 -1
View File
@@ -40,7 +40,7 @@ function shownPiece(node: AdfNode, lineFeed: string): string {
return linkedText(node, shownText(node), shownUrl(node), lineFeed)
}
// As portable markdown writes it inline (docs/decisions.md §The HTML dialect).
// Links an image as portable markdown does inline (docs/decisions.md §The HTML dialect).
function linkedImage(media: AdfNode, lineFeed: string): string {
const image = shownImage(media, shownLink(media)?.href)
const shown = linkedText(media, image?.text, image?.link, lineFeed)