Skip to content

fix(jira): replace hand-rolled markdownToAdf with marklassian library for proper table support#556

Merged
zbigniewsobiecki merged 1 commit intodevfrom
feature/jira-adf-table-support
Feb 25, 2026
Merged

fix(jira): replace hand-rolled markdownToAdf with marklassian library for proper table support#556
zbigniewsobiecki merged 1 commit intodevfrom
feature/jira-adf-table-support

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Feb 25, 2026

Summary

  • Replaces the hand-rolled markdownToAdf() implementation in src/pm/jira/adf.ts with a re-export from the marklassian library, which correctly converts markdown tables (and other elements like links, strikethrough) to valid ADF
  • Extends adfToPlainText() with table, tableRow, tableHeader, and tableCell node handling so that ADF tables round-trip correctly to markdown table format
  • Updates and extends tests/unit/pm/jira/adf.test.ts to cover table conversion, link marks, and round-trip scenarios

Problem

Markdown tables in Jira comments were rendering as raw ASCII instead of formatted tables. The previous hand-rolled markdownToAdf() had no table or link handling — table syntax fell through to a paragraph node and was sent to Jira verbatim.

Test plan

  • All 36 adf.test.ts tests pass (including new table, link, and roundtrip tests)
  • All 50 adapter.test.ts tests pass (no regressions)
  • TypeScript type checking passes with zero errors
  • Biome lint/format passes with zero errors

Card

https://trello.com/c/699f3d7117b9248cd60bd189

🤖 Generated with Claude Code

@aaight
Copy link
Copy Markdown
Collaborator Author

aaight commented Feb 25, 2026

⚙️ On it — checking the CI failures for feature/jira-adf-table-support


Progress: [██░░░░░░░░] 24% (iteration 17/70)

🔧 CI Fix Update (1 min)

I've identified that the CI failure is due to a transient npm registry error (403 Forbidden for yallist-3.1.1.tgz) during the Install web dependencies step, not an issue with the PR's code. I've confirmed this by reviewing the CI logs and locally verifying that linting, TypeScript checks, and unit tests all pass. I'm currently running the full test suite and build locally to ensure everything is in order before attempting a re-run of the CI.

Last updated: iteration 17 · respond-to-ci

@aaight
Copy link
Copy Markdown
Collaborator Author

aaight commented Feb 25, 2026

CI Failure Analysis

Root Cause

The lint-and-test check failed due to a transient npm registry error — not a code issue:

npm error 403 403 Forbidden - GET https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz

This occurred during the Install web dependencies step (cd web && npm ci), before any code checks (lint, typecheck, tests, build) could run.

Local Verification

All CI pipeline steps pass locally:

  • Build: TypeScript compilation successful
  • Typecheck: Zero errors
  • Lint (Biome): 660 files checked, zero issues
  • Tests: 190 test files, 3286/3286 tests passed (including all 36 adf.test.ts tests)

Action Taken

  • Re-triggered the failed CI run via gh run rerun --failed
  • No code changes needed — this is an npm registry infrastructure issue

@nhopeatall
Copy link
Copy Markdown
Collaborator

nhopeatall commented Feb 25, 2026

✨ On it — checking the feature/jira-adf-table-support branch


Progress: [███░░░░░░░] 31% (iteration 22/70)

🔍 Code Review Update (1 min)
I've been reviewing the marklassian library, specifically its markdownToAdf function, to understand its return type and ensure compatibility. I've confirmed that the change from unknown to AdfDocument for the return type is compatible with the Jira client, as it expects unknown for ADF body types. I've also verified that marked v15 is compatible with marklassian's peer dependencies and that there are no duplicate marked installations. I'm now focusing on the table case within convertAdfNode.

Last updated: iteration 22 · review

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean replacement of hand-rolled markdown→ADF converter with a well-scoped library, preserving the module boundary via re-export pattern.

What I verified:

  • marklassian returns AdfDocument (typed { version: 1, type: "doc", content: AdfNode[] }) which is compatible with all existing callers that accept unknown
  • The re-export from src/pm/jira/adf.ts means all 6 callers (adapter, acknowledgments, caching, etc.) continue importing from the same path — no import changes needed
  • marked v15.0.12 already in the lock file is compatible with marklassian's peer dep (^15.0.6 || ^16.0.0) — no duplicate installs
  • The adfToPlainText table rendering correctly: iterates rows/cells inline, inserts | --- | separator after the first row, trims cell text, handles empty cells
  • All 36 tests pass, including roundtrip tests that exercise both directions
  • CI green (lint, typecheck, unit tests, integration tests)

@zbigniewsobiecki zbigniewsobiecki merged commit 5fbb94d into dev Feb 25, 2026
10 of 11 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feature/jira-adf-table-support branch March 16, 2026 16:43
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.

3 participants