You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prevent title and subtitle duplication in published post bodies #537
When a Markdown source contains title and subtitle front matter and repeats those values at the start of the Markdown body, the resulting Substack draft can show the title/subtitle both in Substack's header fields and in the article body.
Initial evidence
Front matter is correctly removed by parseFrontmatter().
preparePost() removes only a leading Markdown heading that exactly matches the resolved title.
It does not remove a matching leading subtitle paragraph/heading.
Checked-in examples/basic.md currently repeats the front-matter title as a body H1.
Documentation does not state the canonical no-duplication source shape.
Agent integration packages provide MCP launch metadata but no authoring guardrail for this ambiguity.
Reproduction
---title: "Example title"subtitle: "Example subtitle"---# Example title
Example subtitle
Actual body.
Expected prepared body: Actual body.
Actual prepared body: subtitle remains in the generated ProseMirror body. Title removal is limited to an exact leading heading match and is not documented.
Acceptance criteria
Normalize an exact leading title plus exact leading subtitle out of the prepared body without removing legitimate non-matching content.
Cover title-only, title+subtitle, formatting, mismatch, and no-front-matter cases with regression tests.
Document one canonical source format for users and agents.
Correct misleading checked-in examples.
Preserve title fallback from a leading heading when front matter has no title.
Resolved by T18-01. Exact leading title/subtitle metadata repetitions are normalized at the shared preparation boundary; mismatches and fallback behavior are preserved. Local verification: 14 focused tests, 933 total tests, typecheck and contract checks passed.
Behavior: exact leading explicit title headings/paragraphs and subtitle headings/paragraphs are removed from prepared Markdown, HTML, and ProseMirror content; mismatches, later matches, and heading fallback are preserved
Local verification: 14 focused tests; 117 files/933 tests; typecheck, Biome, contracts, and programme drift passed
Hosted verification: required PR checks passed; Codecov confirmed all modified coverable lines covered; post-merge Security, Hardening, compatibility, Pages, release, programme drift (where applicable), and CI mutation passed
Activity
edithatogo commentedon Aug 10, 2026
Resolved by T18-01. Exact leading title/subtitle metadata repetitions are normalized at the shared preparation boundary; mismatches and fallback behavior are preserved. Local verification: 14 focused tests, 933 total tests, typecheck and contract checks passed.
Fix title and subtitle body duplication (#542)
Close T18-01 patch coverage gap (#543)
edithatogo commentedon Aug 10, 2026
T18-01 closeout receipt:
59e5dfc3ca76b53250fba450b247f70dc6af0003cdbb8e9a75c70495c687d0790aa694fb2da29127masteris at remote merge SHAcdbb8e9a75c70495c687d0790aa694fb2da29127