Skip to content

fix(converters): stop blog footer turning the last body line into a heading#75

Open
abhay-codes07 wants to merge 1 commit into
dodopayments:mainfrom
abhay-codes07:fix/blog-converter-setext-heading
Open

fix(converters): stop blog footer turning the last body line into a heading#75
abhay-codes07 wants to merge 1 commit into
dodopayments:mainfrom
abhay-codes07:fix/blog-converter-setext-heading

Conversation

@abhay-codes07

Copy link
Copy Markdown

Summary

The blog converter joined its footer onto the body with no blank line, so the output ended with last body line\n---. CommonMark reads that as a setext H2, so the final line of every blog post body was rendered as a heading and the horizontal rule before the footer links vanished. This adds the missing blank line.

Closes #74.

Changes

  • packages/converters/src/blog.ts: separate the body from the footer with a blank line so the trailing --- is a thematic break, not a setext underline.
  • Added a regression test asserting the last body line is followed by a blank line and ---, and is not glued directly to ---.

Type

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • Spec change (requires bump in AEO_SPEC_VERSION)
  • Docs / examples / tooling only

Verification

  • bun run build passes
  • bun run test passes (converters: 39 tests)
  • bun run typecheck passes
  • If touching examples: ran dualmark verify (no examples touched)
  • If touching /spec/: ran sync-spec (no spec files touched)

Changeset

  • Added a changeset (patch for @dualmark/converters)

cc @thepushkaraj @aagarwal1012. Small one, but it affects the rendered markdown of every blog post that has a body.

…eading

The footer was concatenated onto the body with no blank line, so output
ended with 'last body line\n---'. CommonMark parses text immediately
followed by '---' as a setext H2, so the final line of every blog post
body became a heading and the intended horizontal rule was dropped. Add a
blank line between the body and the footer so '---' is a thematic break.
Copilot AI review requested due to automatic review settings July 1, 2026 02:15
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

@abhay-codes07 is attempting to deploy a commit to the Dodo Payments Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes a CommonMark rendering bug in the blog markdown converter where the footer’s --- could be parsed as a setext heading underline for the final body line, causing the rule to disappear and the last line to render as an H2.

Changes:

  • Insert an extra newline between the blog post body and the footer so the footer’s --- is parsed as a thematic break, not a setext underline.
  • Add a regression test to ensure the output contains last body line\n\n--- (and not last body line\n---).
  • Add a changeset for a patch release of @dualmark/converters.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/converters/src/blog.ts Adds a separating newline between body and footer to prevent setext heading parsing.
packages/converters/test/converters.test.ts Adds a regression test asserting the body/footer separation behavior.
.changeset/blog-converter-setext-heading.md Records the bug fix as a patch changeset for release notes/versioning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +55 to +57
// Separate the body from the footer with a blank line. `base` ends with the
// body's last line (no trailing newline) and `footer` starts with "---";
// without the blank line CommonMark parses "lastline\n---" as a setext H2,
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.

blog converter turns the last body line into a heading (setext H2)

2 participants