diff --git a/CHANGELOG.md b/CHANGELOG.md index cbb5194..17a4ec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` whose error names the branch that refused, and `MIGRATION.md` shows the change. - `readAdfDocument`, `adfToHtml`, `adfToLosslessMarkdown` and `adfToPortableMarkdown` read the diff --git a/README.md b/README.md index 0e1c2d6..5288624 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/adf/shown-text.ts b/src/adf/shown-text.ts index 469ee20..7bed7e8 100644 --- a/src/adf/shown-text.ts +++ b/src/adf/shown-text.ts @@ -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 } diff --git a/src/html/carry-content.ts b/src/html/carry-content.ts index 3a0a8c4..ec894d1 100644 --- a/src/html/carry-content.ts +++ b/src/html/carry-content.ts @@ -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)