# Changelog
## Unreleased
- `adfToHtml` writes a media single, a media group and a caption as `` holding an
`` and a ``, and as `
` of `` files, where
`0.3.1` wrote the carry element, and `htmlToAdf` reads them back. A link around the image is the media's link
mark. The carry element `0.3.1` wrote for them still reads.
- `adfToHtml` writes underline as ``, subscript and superscript as `` and ``, a text colour as
``, a background colour as `` and a paragraph's or
heading's alignment as `style="text-align:…"`, where `0.3.1` wrote the carry element, and `htmlToAdf` reads them
back. The carry element `0.3.1` wrote for them still reads.
- `adfToHtml` writes a paragraph's or heading's indentation as `data-indent-level="2"`, where `0.3.1` wrote the carry
element, and `htmlToAdf` reads it back. The carry element `0.3.1` wrote for it still reads.
- `htmlToAdf` reads an expand's ``, as a browser writes one its user opened, as the same expand.
- `adfToHtml` writes a panel as `
`, an expand and a nested expand as `` with the
title in a ``, a task list as `
` of items each a checkbox then its text, and a
decision list as `
`, where `0.3.1` wrote the carry element, and `htmlToAdf` reads
them back. The carry element `0.3.1` wrote for them still reads.
- `adfToHtml` writes a `strike` mark as ``, where `0.3.1` wrote the carry element, and `htmlToAdf` reads
`` as `strike`. The carry element `0.3.1` wrote for it still reads.
- `adfToPlainText` writes a document as text with no markup, for a search index, a notification or an
email: blocks a blank line apart; `• ` and `1.` list markers, `☑ ` and `☐ ` for a done and an open
task, nesting indented; a link's address and title in parentheses after its text; a hard break as a
line feed; a mention, emoji, date or status as the text it shows; a table as a line per row, its
cells apart by ` | `; an image as its alt text and address, the address alone with no alt text, `[image]`
with neither; a card as its address, or its name then its address; an extension as its text; and an
expand's title above its body. It refuses what `adfToHtml`
refuses.
- `readAdfDocument` and the four writers name the node `not-an-adf-document` refuses: `path` leads
to a node that is not an ADF node, and the message says what is wrong with it, such as which
attribute holds a value that is not JSON. A getter, an object holding itself, a throwing Proxy
and a bad array length are still refused at the empty path.
- **Breaking:** `portableMarkdownToAdf` reads more of GFM's pipe table. A body row holding fewer
cells than the header is padded with empty cells, where `0.3.1` returned `malformed-pipe-table`;
a table whose padding would add more cells than the table holds is `malformed-pipe-table`.
A line after the table that holds no `|` and opens no other block is a row of one cell, where it
was a paragraph. A row holding more cells stays an error result.
- **Breaking:** `a |` over `--- |` is a one-column table. `portableMarkdownToAdf` reads it as one,
and `losslessMarkdownToAdf` returns `malformed-pipe-table` for it, as for any table without
leading pipes, where `0.3.1` read both as a paragraph. `MIGRATION.md` shows the change.
- `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
document once into a plain copy. A document holding an accessor property, or a Proxy that throws,
returns `not-an-adf-document`, where `0.3.1` ran the getter, looped or threw. The copy keeps own
enumerable keys alone, so an inherited or non-enumerable key drops. A document of more than
10,000,000 JSON values returns `unsupported-node-shape`.
## 0.3.1
- The README opens with a one-line description, a list of the calls and the package's perks, and
`package.json`'s description, which npmjs shows, is now that same line, naming Jira and Confluence.
## 0.3.0
- **Breaking:** `adfToPortableMarkdown` refuses, as `unsupported-node-shape`, a known block holding
`text`, a known non-text inline node holding `text` or non-empty `content`, and a known block that
takes no content, such as `rule`, holding non-empty `content`. `adfToLosslessMarkdown` now refuses
them inside a carried node too, and `losslessMarkdownToAdf` refuses a carry holding one.
`MIGRATION.md` says how to convert stored markdown.
- **Breaking:** `losslessMarkdownToAdf` gives a `date`, `emoji`, `inlineCard`, `mention`, `status`
or `mediaInline` only the marks Atlassian's schema lets it hold: `**!adf:mention[@A]{id=…}**` now
reads as a plain mention. A link or directive mark around only nodes that cannot take it is
`unsupported-node-shape`, even in markdown `adfToLosslessMarkdown` wrote. A link around hard
breaks alone still reads as before. `adfToLosslessMarkdown` writes a node holding a mark its type
cannot take as `!adf:carry{json="…"}`, except an inline card a link marks, which it refuses.
`MIGRATION.md` says how to convert stored markdown.
- **Breaking:** `adfToLosslessMarkdown` and `adfToPortableMarkdown` refuse an inline card a link marks
as `unsupported-node-shape` at the card's path, and `losslessMarkdownToAdf` refuses a carry
holding one, since Atlassian's schema gives a card no link mark. `MIGRATION.md` says what to do.
- **Breaking:** every reader gives code text no mark but `link` and `annotation`, as Atlassian's
schema requires: ``**`npm ci`**`` now reads as plain code, and a directive mark other than a link
around only code spans is `unsupported-node-shape`. `adfToLosslessMarkdown` writes code text
holding another mark as `!adf:carry{json="…"}`, and `adfToPortableMarkdown` drops that mark.
- **Breaking:** `losslessMarkdownToAdf` gives text no `border` mark, as Atlassian's schema requires:
`!adf:border[x]{color="#091e42" size=2}` is `unsupported-node-shape`, and only a
`mediaInline` takes `border`. `adfToLosslessMarkdown` writes text holding `border` as `!adf:carry{json="…"}`.
`MIGRATION.md` says how to convert stored markdown.
- `docs/feature-table.md` sets example documents beside what `adfToLosslessMarkdown`,
`adfToPortableMarkdown` and `adfToHtml` write for them, and says whether each output reads back to
the same document.
- The package's description and keywords say it needs no React, Atlaskit or runtime dependency and
runs in Node, Forge, Deno, Bun and browsers, and the README opens with the call to take for each
need. The README's first comparison table lists the npm packages running in Node that convert ADF
to or from markdown, wrappers and forks aside; its second table lists other ecosystems'
libraries and Atlassian's own paths.
- `adfToHtml` writes ADF as HTML: paragraphs, headings, lists, quotes, tables, code blocks, rules,
hard breaks, a centered, uncaptioned external image holding no attribute but its URL and alt, and
`em`, `strong`, `code` and links as their elements. An unmarked emoji, mention, status, date
and card holding a URL, or `data` holding one, not both, are ``,
``, ``, `