# What each call writes
Each section sets a sample ADF document beside what each call writes for it, then reads that output back: `adfToLosslessMarkdown` with `losslessMarkdownToAdf`, `adfToPortableMarkdown` with `portableMarkdownToAdf`, `adfToHtml` with `htmlToAdf`. `holds` means the reader gives the same document, `loses` a different one, and `refused` that the writer or reader returned an error, whose code the section names.
A result covers that example alone, and the examples are plain. Portable markdown keeps only the attributes its spelling holds, such as a heading's level and a link's target, so a document holding any other loses it even where its row says `holds`: to edit and save back, use `adfToLosslessMarkdown` and `losslessMarkdownToAdf`. An image holding more than the alt, layout, type and url of this page's example, as editor-written ones do, rides the carry element in HTML, where this page shows ``.
`./feature-table/write.sh` writes this page. Don't edit it by hand.
| Example | Lossless | Portable | HTML |
| --- | --- | --- | --- |
| [Bold instruction with a command in it](#bold-instruction-with-a-command-in-it) | holds | holds | holds |
| [Emphasis and strikethrough](#emphasis-and-strikethrough) | holds | holds | holds |
| [Headings](#headings) | holds | holds | holds |
| [Bullet list](#bullet-list) | holds | holds | holds |
| [Code block](#code-block) | holds | holds | holds |
| [Quote](#quote) | holds | holds | holds |
| [Link](#link) | holds | holds | holds |
| [Table](#table) | holds | holds | holds |
| [Panels](#panels) | holds | loses | holds |
| [Task list](#task-list) | holds | loses | holds |
| [Image](#image) | holds | holds | holds |
| [Mention](#mention) | holds | loses | holds |
| [Status](#status) | holds | loses | holds |
| [Date](#date) | holds | loses | holds |
| [Node types this version does not know](#node-types-this-version-does-not-know) | holds | loses | holds |
## Bold instruction with a command in it
ADF:
```json
{"content":[{"content":[{"marks":[{"type":"strong"}],"text":"Run ","type":"text"},{"marks":[{"type":"code"}],"text":"npm ci","type":"text"},{"marks":[{"type":"strong"}],"text":" first","type":"text"}],"type":"paragraph"}],"type":"doc","version":1}
```
`adfToLosslessMarkdown`, round-trip holds:
```markdown
**Run `npm ci` first**
```
`adfToPortableMarkdown`, round-trip holds:
```markdown
**Run `npm ci` first**
```
`adfToHtml`, round-trip holds:
```html
Run npm ci first
Read the manual before wiring the relay.
An unrealistic goal.
``` ## Headings ADF: ```json {"content":[{"attrs":{"level":1},"content":[{"text":"Assembly","type":"text"}],"type":"heading"},{"attrs":{"level":2},"content":[{"text":"Parts","type":"text"}],"type":"heading"},{"attrs":{"level":3},"content":[{"text":"Fasteners","type":"text"}],"type":"heading"},{"attrs":{"level":4},"content":[{"text":"Bolts","type":"text"}],"type":"heading"},{"attrs":{"level":5},"content":[{"text":"Sizes","type":"text"}],"type":"heading"},{"attrs":{"level":6},"content":[{"text":"M8","type":"text"}],"type":"heading"}],"type":"doc","version":1} ``` `adfToLosslessMarkdown`, round-trip holds: ```markdown # Assembly ## Parts ### Fasteners #### Bolts ##### Sizes ###### M8 ``` `adfToPortableMarkdown`, round-trip holds: ```markdown # Assembly ## Parts ### Fasteners #### Bolts ##### Sizes ###### M8 ``` `adfToHtml`, round-trip holds: ```htmlSELECT id
FROM part
WHERE qty > 0;
- 1. the markers a container start would claim
```
## Quote
ADF:
```json
{"content":[{"content":[{"content":[{"text":"Ship it.","type":"text"}],"type":"paragraph"},{"content":[{"text":"Then tell them.","type":"text"}],"type":"paragraph"}],"type":"blockquote"}],"type":"doc","version":1}
```
`adfToLosslessMarkdown`, round-trip holds:
```markdown
> Ship it.
>
> Then tell them.
```
`adfToPortableMarkdown`, round-trip holds:
```markdown
> Ship it.
>
> Then tell them.
```
`adfToHtml`, round-trip holds:
```html
``` ## Link ADF: ```json {"content":[{"content":[{"text":"See ","type":"text"},{"marks":[{"attrs":{"href":"https://example.com/changelog"},"type":"link"}],"text":"the changelog","type":"text"},{"text":".","type":"text"}],"type":"paragraph"},{"content":[{"marks":[{"attrs":{"href":"https://example.com/"},"type":"link"}],"text":"https://example.com/","type":"text"}],"type":"paragraph"},{"content":[{"text":"Read ","type":"text"},{"marks":[{"attrs":{"href":"https://example.com/guide","title":"Setup guide"},"type":"link"}],"text":"the guide","type":"text"},{"text":".","type":"text"}],"type":"paragraph"},{"content":[{"text":"Open ","type":"text"},{"marks":[{"attrs":{"href":"https://example.com/the plan.pdf"},"type":"link"}],"text":"the plan","type":"text"},{"text":".","type":"text"}],"type":"paragraph"},{"content":[{"marks":[{"attrs":{"href":"/parts/m8"},"type":"link"}],"text":"/parts/m8","type":"text"}],"type":"paragraph"}],"type":"doc","version":1} ``` `adfToLosslessMarkdown`, round-trip holds: ```markdown See [the changelog](https://example.com/changelog).Ship it.
Then tell them.
See the changelog.
Read the guide.
Open the plan.
``` ## Table ADF: ```json {"content":[{"content":[{"content":[{"content":[{"content":[{"text":"Part","type":"text"}],"type":"paragraph"}],"type":"tableHeader"},{"content":[{"content":[{"text":"Stock","type":"text"}],"type":"paragraph"}],"type":"tableHeader"}],"type":"tableRow"},{"content":[{"content":[{"content":[{"text":"Bolt M8","type":"text"}],"type":"paragraph"}],"type":"tableCell"},{"content":[{"content":[{"text":"120","type":"text"}],"type":"paragraph"}],"type":"tableCell"}],"type":"tableRow"},{"content":[{"content":[{"content":[{"text":"Washer M8","type":"text"}],"type":"paragraph"}],"type":"tableCell"},{"content":[{"content":[{"text":"45","type":"text"}],"type":"paragraph"}],"type":"tableCell"}],"type":"tableRow"}],"type":"table"}],"type":"doc","version":1} ``` `adfToLosslessMarkdown`, round-trip holds: ```markdown | Part | Stock | | --- | --- | | Bolt M8 | 120 | | Washer M8 | 45 | ``` `adfToPortableMarkdown`, round-trip holds: ```markdown | Part | Stock | | --- | --- | | Bolt M8 | 120 | | Washer M8 | 45 | ``` `adfToHtml`, round-trip holds: ```html| Part | Stock |
|---|---|
| Bolt M8 | 120 |
| Washer M8 | 45 |
Check the collation before importing.
Backups run at 02:00.
Weather permitting.
Write the spec
Ship it
Check the torque.
Then sign off.
Nested step
Taken from the roof last night.

Ping @Mikael before merging.
``` ## Status ADF: ```json {"content":[{"content":[{"text":"The rebuild is ","type":"text"},{"attrs":{"color":"yellow","localId":"01a033a7-d68a-71a9-a58a-edf5757ad176","style":"bold","text":"In review"},"type":"status"},{"text":" until Friday.","type":"text"}],"type":"paragraph"}],"type":"doc","version":1} ``` `adfToLosslessMarkdown`, round-trip holds: ```markdown The rebuild is !adf:status[In review]{color=yellow localId=01a033a7-d68a-71a9-a58a-edf5757ad176 style=bold} until Friday. ``` `adfToPortableMarkdown`, round-trip loses: ```markdown The rebuild is In review until Friday. ``` `adfToHtml`, round-trip holds: ```htmlThe rebuild is In review until Friday.
``` ## Date ADF: ```json {"content":[{"content":[{"text":"Due ","type":"text"},{"attrs":{"timestamp":"1756080000000"},"type":"date"},{"text":", reviewed ","type":"text"},{"attrs":{"localId":"01a033ab-781c-7f79-9c8a-fb63356c1cad","timestamp":"1735689600000"},"type":"date"},{"text":".","type":"text"}],"type":"paragraph"}],"type":"doc","version":1} ``` `adfToLosslessMarkdown`, round-trip holds: ```markdown Due !adf:date{timestamp=1756080000000}, reviewed !adf:date{localId=01a033ab-781c-7f79-9c8a-fb63356c1cad timestamp=1735689600000}. ``` `adfToPortableMarkdown`, round-trip loses: ```markdown Due 2025-08-25, reviewed 2025-01-01. ``` `adfToHtml`, round-trip holds: ```htmlDue , reviewed .
``` ## Node types this version does not know ADF: ```json {"content":[{"attrs":{"url":"https://example.com/roadmap"},"type":"blockCard"},{"attrs":{"panelType":"info"},"content":[{"content":[{"text":"The card below has no spelling yet.","type":"text"}],"type":"paragraph"},{"attrs":{"layout":"wide","url":"https://example.com/board","width":100},"type":"embedCard"}],"type":"panel"}],"type":"doc","version":1} ``` `adfToLosslessMarkdown`, round-trip holds: ````markdown ```adf:blockCard { "attrs": { "url": "https://example.com/roadmap" } } ``` !adf:panel info The card below has no spelling yet. ```adf:embedCard { "attrs": { "layout": "wide", "url": "https://example.com/board", "width": 100 } } ``` !adf:/panel ```` `adfToPortableMarkdown`, round-trip loses: ```markdownThe card below has no spelling yet.