fix: editing presenter notes on frontmatter-only slides#2591
Merged
antfu merged 1 commit intoMay 19, 2026
Conversation
✅ Deploy Preview for slidev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@slidev/client
create-slidev
create-slidev-theme
@slidev/parser
@slidev/cli
@slidev/types
commit: |
antfu
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix presenter/browser note editing for slides whose editor content is only a frontmatter block, such as image-layout slides with no Markdown body.
Root Cause
The side editor trims the editor content before splitting out slide frontmatter. For a frontmatter-only slide, trimming removes the newline after the closing
---, so the previous regex did not recognize the frontmatter block. The save path then sent that frontmatter back as slide body content, which could be parsed as a new slide on reload/HMR. With autosave enabled, this could create repeated image slides containing partial note edits.This also updates the dev server note patch guard so an empty string note can be saved, allowing notes to be cleared from the editor.
Changes
note: ''as an intentional note update on the dev server.Validation
pnpm exec eslint packages/client/internals/SideEditor.vue packages/client/logic/sideEditor.ts packages/slidev/node/vite/loaders.ts test/side-editor.test.tspnpm exec vitest run test/side-editor.test.tspnpm run buildpnpm testI also manually reproduced this with a personally-themed deck containing consecutive
layout: imageslides, then verified the patched editor no longer creates additional slides while editing presenter notes.