mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-13 04:08:29 +01:00
Answer stability round 1: 0 🔴, 1 🟡; pin a link after another mark on the image
This commit is contained in:
@@ -374,7 +374,7 @@ saving what this pair read replaces mentions, attachments and macros with text.
|
||||
| `backgroundColor` | `==text==` | `==text==` on one line, the text touching both delimiters, bounded outside by whitespace, punctuation or a line edge, or touching a Han, Hangul, Hiragana, Katakana, Thai, Lao, Khmer or Myanmar character on either side, in the editor's default highlight `#f8e6a0` |
|
||||
| `decisionList` | a bullet list | — |
|
||||
| `expand`, `nestedExpand` | Obsidian's folded callout, `> [!NOTE]- Title` | `-` or `+` after any word, the rest of the marker's line the title; a link reads `text (target)`, or its text alone where the text is the target with or without `mailto:`; an expand inside an expand is a `nestedExpand` |
|
||||
| external `media` | in a block ``, or `[](href)` where a link marks it; inline `[alt](url)`, or `[alt](href) ([image](url))` where a link to another target marks it, the link text `href`, else `url`, where `alt` is empty | — |
|
||||
| external `media` | in a block ``, or `[](href)` where a link marks it; inline `[alt](url)`, or `[alt](href) ([image](url))` where a link to another target marks it, the link text `href` where `alt` is empty, or `url` where both are | — |
|
||||
| `inlineCard`, `blockCard`, `embedCard` | a link to the card's URL, else its name | — |
|
||||
| `layoutSection`, `bodiedExtension`, `bodiedSyncBlock`, `multiBodiedExtension`, `extensionFrame`, `caption`, a node this version does not know | its blocks or its text | — |
|
||||
| `mention`, `status`, `emoji`, `date` | their text: `@` kept, a mention with none `@` and its id, an emoji its `shortName` without, a date `2026-09-13` in UTC | — |
|
||||
|
||||
@@ -247,6 +247,8 @@ test('keeps both targets of a linked external image standing inline, the image l
|
||||
assert.equal(inCell, '| h |\n| --- |\n| [Moon](https://example.com/docs "Docs") ([image](https://example.com/moon.png)) |\n')
|
||||
const read = portableMarkdownToAdf(inCell)
|
||||
assert.equal(read.ok && portableDocument(read.value), inCell)
|
||||
const bordered: AdfNode = { attrs: { alt: 'Moon', type: 'external', url: 'https://example.com/moon.png' }, marks: [{ attrs: { color: '#000', size: 1 }, type: 'border' }, { attrs: { href: 'https://example.com/docs' }, type: 'link' }], type: 'media' }
|
||||
assert.equal(portable(table(node('mediaSingle', {}, bordered))), '| h |\n| --- |\n| [Moon](https://example.com/docs) ([image](https://example.com/moon.png)) |\n')
|
||||
assert.equal(portable(table(said('See'), node('mediaSingle', {}, linked('https://example.com/docs')))), '| h |\n| --- |\n| See [https://example.com/docs](https://example.com/docs "Docs") ([image](https://example.com/moon.png)) |\n')
|
||||
assert.equal(portable(paragraph(text('See '), linked('https://example.com/moon.png', 'Moon'))), 'See [Moon](https://example.com/moon.png "Docs")\n')
|
||||
assert.equal(portable(paragraph(text('See '), linked('https://example.com/moon.png'))), 'See [https://example.com/moon.png](https://example.com/moon.png "Docs")\n')
|
||||
|
||||
Reference in New Issue
Block a user