Skip to content

feat(adf): give a ticket's blocks their Markdown shape - #40

Merged
Bakhomious merged 1 commit into
mainfrom
step/adf-blocks
Nov 4, 2026
Merged

Bakhomious merged 1 commit into
mainfrom
step/adf-blocks

Conversation

@Bakhomious

Copy link
Copy Markdown
Contributor

Step adf-blocks (plan row 63): the second half of the converter from #39. internal/adf now gives the blocks of the Atlassian Document Format their Markdown shape. Before this, they fell back to their plain content.

What changes

  • Headings keep their level, kept between 1 and 6, and a heading without one gets level 1.
  • Lists keep their nesting: an item's blocks stand on the lines under its marker, indented to it. An ordered list starts at its order, 0 included.
    • A task shows as - [ ] or - [x]. A block task item holds paragraphs, and a nested task list sits as it is under the item before it.
    • A decision shows as a bullet.
  • Code blocks keep their language, in a fence of at least three backticks that their code can't end.
  • Quotes and panels show as a quote. The panel's kind (info, warning…) drops, and an empty line inside keeps a bare >.
  • Rules show as ---. Expands, which Jira shows folded, nested ones included, show their title in bold above their content.
  • Tables become Markdown tables:
    • The first row is the header, since a Markdown table needs one.
    • Each row is as wide as the widest.
    • Each cell stays on one line, with <br> for a line break and \| for a |.
  • Docs: decision 57 gains the blocks' rules. The status table: adf Done (feat(adf): render Jira's document format as Markdown #39), adf-blocks In review (feat(adf): give a ticket's blocks their Markdown shape #40).

Checks

  • mise run check: green. Coverage 99.4%; internal/adf 100%.
  • Golden tests: four new ADF documents (headings, lists, code and quotes, tables), and the rule and expands in blocks. A task list in inline now renders as one.
  • Mutation probes: 52 mutants, all caught. They cover each block type's case, the separators between blocks, items, rows and cells, the prefix's trimming, the heading's clamps and default, the code fence's floor and language, the expand's title, a list's start, positions, markers, nesting and indents, and the table's header, padding, width and escapes. One survivor came up first: a nestedExpand without a title rendered the same through the fallback. Its test now has a title, and an untitled expand of its own tests the rest.
  • Smoke run: the made-up ticket from feat(adf): render Jira's document format as Markdown #39, now with nested lists, a task list, a rule, a table and an expand, rendered through a throwaway test. Every block came out in its Markdown shape.

Not in this PR: jira (baton jira <KEY>), next. Two nudge asks are still open for it: the Keychain read's G204 handling, and a live check against one real ticket.

internal/adf now renders the blocks of Jira's document format as
Markdown's own: headings at their level, lists, task lists and
decision lists with their nesting, code blocks in a fence that their
code can't end, quotes and panels as quotes, rules, expands under
their title in bold, and tables as Markdown tables, whose first row is
the header and whose cells stay on one line.

Decision 57 in docs/plan.md gains the blocks' rules.
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@Bakhomious
Bakhomious merged commit a79139f into main Nov 4, 2026
3 checks passed
@Bakhomious
Bakhomious deleted the step/adf-blocks branch November 4, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant