fix(format): leave a single blank line after the frontmatter #314

Merged
abiwab merged 1 commit from fix/format-frontmatter-blank-lines into main 2026-11-29 18:32:56 +01:00
Owner

Several blank lines right after the frontmatter came down to two instead of one: the frontmatter segment keeps the line break of its closing ---, so the body's own leading line breaks were already blank lines and the global "3+ line breaks → 2" rule left one too many.

  • The first body segment after a frontmatter has its leading run of 2+ line breaks brought down to one (counted in consecutiveBlankLines).
  • No blank line at all after the frontmatter is left as written.
  • Test in formatter.test.ts (2, 3 and 4 blank lines, idempotence); patch changeset.

Found while testing zed-gram by hand, but it is the formatter's behavior in every editor and in gram format. Once merged, main goes into dev/1.6.

Several blank lines right after the frontmatter came down to two instead of one: the frontmatter segment keeps the line break of its closing `---`, so the body's own leading line breaks were already blank lines and the global "3+ line breaks → 2" rule left one too many. - The first body segment after a frontmatter has its leading run of 2+ line breaks brought down to one (counted in `consecutiveBlankLines`). - No blank line at all after the frontmatter is left as written. - Test in `formatter.test.ts` (2, 3 and 4 blank lines, idempotence); `patch` changeset. Found while testing `zed-gram` by hand, but it is the formatter's behavior in every editor and in `gram format`. Once merged, `main` goes into `dev/1.6`.
fix(format): leave a single blank line after the frontmatter
All checks were successful
CI / Build & Test (pull_request) Successful in 4m51s
7cca5c270e
abiwab merged commit f727dfb9f9 into main 2026-11-29 18:32:56 +01:00
abiwab deleted branch fix/format-frontmatter-blank-lines 2026-11-29 18:32:57 +01:00
Sign in to join this conversation.
No description provided.