Skip to content

fix(whatsnew): render GFM tables in release notes (#235) - #238

Merged
tylergraydev merged 1 commit into
mainfrom
fix/whatsnew-table-rendering
May 16, 2026
Merged

tylergraydev merged 1 commit into
mainfrom
fix/whatsnew-table-rendering

Conversation

@tylergraydev

Copy link
Copy Markdown
Owner

Closes #235.

What was wrong

WhatsNewModal's hand-rolled renderMarkdown() handled headers, bold, italic, code blocks, inline code, links, and bullet lists — but had no table support. GFM tables in release notes (e.g. the Download platform table in release.yml lines 123–128) fell through and rendered as raw markdown pipes, which is what the issue reporter saw:

| Platform | Download |
|----------|----------|
| Windows  | .msi     |

Fix

Added a table-handling step in renderMarkdown between the list wrapping and newline conversion. Parses the standard GFM 3-part shape (header line, separator line, one-or-more body lines) and emits a styled <table> with <thead> / <tbody>. Honors column alignment specifiers (:---, :---:, ---:) via inline text-align style. Tailwind classes match the rest of the modal's palette (gray-200/700 borders for the header row, gray-100/800 for body rows).

Ordering note: the table substitution runs before the \n\n → </p><p> and \n → <br> conversions, so the table block's internal newlines survive long enough to be parsed.

Regression tests added

  • should render GFM tables in release notes (#235) — renders a modal with a 2-column, 2-row table body and asserts the DOM has a real <table> with the right header/row counts and cell text.
  • should honor table column alignment specifiers — asserts :--- / :---: / ---: produce the corresponding text-align style on the header cells.

Test plan

  • npx vitest run shared.test.ts — 31/31 pass (29 existing + 2 new)
  • npm run check — 53 errors (same as main baseline; no new type errors introduced)
  • Manual: open the app on a version with a tabled release, confirm the table renders

🤖 Generated with Claude Code

Closes #235.

## What was wrong

`WhatsNewModal`'s hand-rolled `renderMarkdown()` handled headers, bold,
italic, code blocks, inline code, links, and bullet lists — but had no
table support. GFM tables in release notes (e.g. the "Download"
platform table in `release.yml`) fell through and rendered as raw
markdown pipes:

    | Platform | Download |
    |----------|----------|
    | Windows  | .msi     |

## Fix

Added a table-handling step in `renderMarkdown` between the list
wrapping and newline conversion. Parses the standard GFM 3-part
shape — header line, separator line, one-or-more body lines — and
emits a styled `<table>` with `<thead>` / `<tbody>`. Honors column
alignment specifiers (`:---`, `:---:`, `---:`) via inline
`text-align` style. Matched Tailwind classes to the rest of the
modal's palette (gray-200/700 borders for the header row,
gray-100/800 for body rows).

The substitution runs BEFORE the `\n\n` → `</p><p>` and `\n` → `<br>`
conversions so the table block's internal newlines survive long
enough to be parsed.

## Regression tests added

- `should render GFM tables in release notes (#235)` — renders a
  modal with a 2-column, 2-row table body and asserts the DOM has a
  real `<table>` with the right header/row counts and cell text.
- `should honor table column alignment specifiers` — asserts left /
  center / right specifiers produce the corresponding `text-align`
  style on the header cells.

## Test plan

- [x] `npx vitest run shared.test.ts` — 31/31 pass (29 + 2 new)
- [x] `npm run check` — 53 errors (same as `main` baseline, no new
      type errors introduced)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tylergraydev
tylergraydev merged commit 55281a5 into main May 16, 2026
10 checks passed
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.

[Bug]: Changelog Table Rendering

1 participant