test(loop-sync): add CRLF frontmatter regression tests - #496
Open
pxmpsdev wants to merge 3 commits into
Open
Conversation
- body slice kept a leading newline (off-by-one) that duplicated the closing fence's own line break into the body - a closing fence like '---oops' (no newline after it) was accepted as a valid frontmatter terminator
Export extractFrontmatter so the tests can exercise it directly. Covers LF parsing, CRLF parsing without trailing CR, and rejection of opening and closing fences without newlines.
pxmpsdev
force-pushed
the
test/479-loop-sync-crlf-tests
branch
from
August 10, 2026 09:19
2639491 to
b3f16e8
Compare
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.
Closes #479
Adds regression tests for
extractFrontmatterCRLF handling (fixed in #476):\r---hello(opening fence without newline) is rejectedExports
extractFrontmatterfromsrc/sync.tsso the tests can exercise it directly, and fixes a body-slicing off-by-one that the new tests exposed (the closing fence's newline was duplicated into the body).cd tools/loop-sync && npm testpasses (11 tests).