Skip to content

fix: put blank lines around changelog headings on the card - #63

Merged
stanlyzoolo merged 1 commit into
mainfrom
fix/changelog-heading-spacing
Aug 5, 2026
Merged

fix: put blank lines around changelog headings on the card#63
stanlyzoolo merged 1 commit into
mainfrom
fix/changelog-heading-spacing

Conversation

@stanlyzoolo

Copy link
Copy Markdown
Owner

Problem

GoReleaser writes release bodies with no blank lines at all — ## Changelog / ### New features / ### Bug fixes sit flush against their bullet lists. markdownToLines only ever collapsed blank runs and never inserted its own, so on the card the whole changelog rendered as one dense block (keepkit's own release card is the screenshot case).

Fix

The heading branch in markdownToLines now calls the existing emitBlank() before and after emitting a heading. emitBlank is idempotent (adds a blank only when the previous line is non-empty, drops leading ones), so:

  • packed GoReleaser bodies get one blank row on each side of every heading;
  • bodies whose author already wrote the blanks come out byte-identical — the inserted blank and the source blank collapse into one;
  • a heading that converts to nothing (badge-only) still yields exactly one blank, via the collapse inside mdEmitInline;
  • no leading blank before the first heading, trailing blanks trimmed as before.

Tests

  • headings h1 to h6 and TestMarkdownToLinesGitHubBody expectations updated for the new spacing.
  • Two new table cases: packed headings get air on both sides (the GoReleaser shape) and authored blanks around headings do not double — both pin identical output for the packed and pre-formatted variants.
  • Mutation-checked: reverting the two emitBlank calls turns all three assertions red.
  • Card visually verified at 120 and 80 columns.

Preflight green: build / vet / test -race / golangci-lint.

GoReleaser release bodies pack headings tight against their lists
(## Changelog\n### New features\n* ...), and markdownToLines only ever
collapsed blank lines, never added its own — so on the card the section
headings sat flush against the bullets with no air at all.

The heading branch now emits a blank row on both sides through the
existing emitBlank collapse: a body whose author already wrote the
blanks comes out unchanged, and a heading that converts to nothing
still yields exactly one blank.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@stanlyzoolo
stanlyzoolo merged commit b18ea6d into main Aug 5, 2026
3 checks passed
@stanlyzoolo
stanlyzoolo deleted the fix/changelog-heading-spacing branch August 7, 2026 19:28
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