3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-12 11:48: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
+2 -3
View File
@@ -2,9 +2,8 @@
## Unreleased
- `adfToPortableMarkdown` keeps the link marking a stored image, an extension or a card with no
text around the note standing in its place, so its target is no longer dropped:
`[_(image not included)_](https://example.com/a)`.
- `adfToPortableMarkdown` keeps a link around the note standing in place of a node it marks, such
as a stored image: `[_(image not included)_](https://example.com/a)`.
- **Breaking:** `readAdfDocument` replaces `isAdfDocument`: it returns a `Result<AdfDocument>` whose
error names the branch that refused, and `MIGRATION.md` shows the change.
- `readAdfDocument`, `adfToHtml`, `adfToLosslessMarkdown` and `adfToPortableMarkdown` read the
+1 -1
View File
@@ -486,7 +486,7 @@ saving what this pair read replaces mentions, attachments and macros with text.
naming it where it stood: `_(image not included)_` for stored media with no `alt`,
`_(link card not included)_` for a card with neither URL nor name, an extension with no `text`
its key, `_(jira-issues-table not included)_`, or `_(extension not included)_` without one, and
`_(synced block not included)_` for a `syncBlock`. A link marking the node stays around its note.
`_(synced block not included)_` for a `syncBlock`. A link marking such a node stays around its note; its other marks drop.
- `backgroundColor`, `code`, `em`, `link`, `strike` and `strong` stay; every other mark drops,
keeping its text, and so does a mark the flavour cannot spell where it stands. A line still
read back wrong after 32 tries drops every `em`, `strike` and `strong` at once. Code text keeps
+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)