Skip to content

fix: preserve middle slides separated by --- without frontmatter (#63)#68

Merged
leoafarias merged 2 commits into
btwld:mainfrom
tilucasoli:tilucasoli/fix-issue-63
May 12, 2026
Merged

fix: preserve middle slides separated by --- without frontmatter (#63)#68
leoafarias merged 2 commits into
btwld:mainfrom
tilucasoli:tilucasoli/fix-issue-63

Conversation

@tilucasoli
Copy link
Copy Markdown
Collaborator

Summary

Fixes #63. The slide splitter toggled a single insideFrontMatter flag on every ---, so the separator after a frontmatter-less slide was wrongly consumed as a closing frontmatter delimiter — the next slide's heading was then parsed as YAML and its content silently dropped. The splitter is rewritten as a two-pass algorithm: first collect --- lines outside fenced code blocks, then treat each as a separator unless it opens a YAML frontmatter pair (recognised only when the lines between are empty or YAML-shaped, never markdown body).

Test plan

  • New regression test covering the issue's three-slide reproducer
  • All 75 existing builder tests still pass
  • All 612 core tests still pass
  • dart analyze clean

🤖 Generated with Claude Code

…ld#63)

The slide splitter toggled a single `insideFrontMatter` flag on every
`---`, so a separator following a non-frontmatter slide was wrongly
consumed as a closing frontmatter delimiter and the next slide's
heading was parsed as YAML, silently dropping its content.

Rewrite the splitter as a two-pass algorithm: first collect `---`
lines outside fenced code blocks, then treat each as a slide separator
unless it opens a YAML frontmatter pair (recognised only when the
content between is empty or YAML-shaped, never markdown body).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@docs-page
Copy link
Copy Markdown

docs-page Bot commented May 9, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/superdeck~68

Documentation is deployed and generated using docs.page.

@tilucasoli
Copy link
Copy Markdown
Collaborator Author

The shape of this fix depends on the design decision still open in #67 (replacing YAML frontmatter with an @slide directive). If #67 lands, --- becomes a pure slide separator and the heuristic YAML-shape detection introduced here is no longer needed — the fix collapses to simply dropping the insideFrontMatter toggle.

Suggest waiting on #67 before merging. Full reasoning: #63 (comment) → #63 (comment)

Copy link
Copy Markdown
Collaborator

@leoafarias leoafarias left a comment

Choose a reason for hiding this comment

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

LGTM

@leoafarias leoafarias merged commit 2c387bd into btwld:main May 12, 2026
4 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.

Slide parsing drops middle slide when separated by ---

2 participants