Repository navigation
Conversation
A slides.md saved with a BOM starts with "\uFEFF---", so the headmatter was not recognized: the deck config was dropped and its YAML became an extra first slide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for slidev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This branch has not been deployed
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.
Bug
If
slides.mdis saved with a UTF-8 byte order mark, the headmatter is ignored. The first line is---, which doesn't start with---, so the parser doesn't see a frontmatter block:Saved with a BOM,
parse()returns 3 slides instead of 2. The first slide has empty frontmatter and its content is---\ntheme: seriph\ntitle: Hello, so the theme, title and other deck config are lost and an extra slide with the raw YAML is shown.load()has the same problem when it looks for the headmatter to load preparser extensions.Editors and tools that write "UTF-8 with BOM" (Notepad's "UTF-8 with BOM" option, Visual Studio, PowerShell 5.1
Set-Content -Encoding UTF8) produce such files, mostly on Windows.Fix
parse()andparseSync()drop a leading BOM before splitting the lines.RE_FRONTMATTER_STARTinfs.tsallows an optional BOM before---.Tests
Added
ignores a leading UTF-8 BOMtotest/parser.test.ts. It checks the slides and frontmatter fromparse()and the headmatter fromload(). It fails without the change and passes with it.I used Claude Code to write this change.