From 2d7d8f8af67f86808e57034e90fef6f5bc894b07 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 22 Oct 2026 21:46:48 +0200 Subject: [PATCH] Spell a portable link title holding a backslash, an entity reference or, in a table cell, a pipe --- CHANGELOG.md | 3 +++ src/markdown/commonmark/link-syntax.ts | 21 ++++++++++++++----- src/markdown/emit/adf-to-markdown.ts | 2 +- src/markdown/emit/image.ts | 5 +++-- src/markdown/emit/inline-line.ts | 21 +++++++++++++------ src/markdown/mark-spellings.ts | 6 +++--- src/markdown/parse/inline-content.ts | 2 +- .../portable/adf-to-portable-markdown.test.ts | 20 ++++++++++++++++-- src/markdown/portable/inline-reduction.ts | 5 ++--- todo.md | 13 +----------- 10 files changed, 63 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6f242d..ffc0a2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ holding another mark as `!adf:carry{json="…"}`, and `adfToPortableMarkdown` drops that mark. - `adfToPortableMarkdown` keeps both targets of a linked external image standing inline, as in a table cell: `[alt](href) ([image](url))`, where it wrote `[alt](url)` and dropped the link's target. +- `adfToPortableMarkdown` keeps a link's title holding a backslash or an entity reference, and in a + table cell one holding a `|`, escaping each: `[docs](https://example.com "C:\\dir")`, where it + dropped the title. `portableMarkdownToAdf` reads it back to the same title. - `losslessMarkdownToAdf` names the CommonMark spelling to write when it refuses a directive whose node CommonMark spells, such as `[![alt](url)](href)` for a linked `!adf:mediaSingle`. - Every reader and writer takes time linear in the text when it holds many `