Repository navigation
Correct line folding in quoted and plain YAML scalars - #257
Merged
Merged
Conversation
Compare normalized line-break strings with a string, condition folded spaces on the absence of blank lines, and retain collected plain-scalar breaks. Correct three fixture values that preserved the old bug, and cover 52 public line-break, blank-line, escape and Unicode-separator cases. AI disclosure: This work was prepared with assistance from OpenAI Codex.
Preserve both the 42 key roundtrips and 52 flow-folding assertions when incorporating current master. Functional folding changes are unchanged. AI disclosure: This work was prepared with assistance from OpenAI Codex.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #257 +/- ##
==========================================
+ Coverage 87.19% 87.56% +0.37%
==========================================
Files 15 15
Lines 1648 1649 +1
==========================================
+ Hits 1437 1444 +7
+ Misses 211 205 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Parsing a multiline single-quoted value in #241 returns a newline where YAML requires a folded space. The same error affects double-quoted and plain values: both scanners compare a normalized line-break
Stringwith the character'\n', so they never reach the ordinary folding branch.Compare with the newline string, insert a folded space only when no blank lines follow, and append the blank-line breaks collected by the plain-scalar scanner. Escaped double-quoted continuations and the existing YAML 1.1 Unicode separator behavior are preserved.
All fixture files and test paths are retained. Three expected values encoded the old bug: the two values in
spec-02-18now use folded spaces, whileissue36retains one line feed from its blank line rather than counting the initial discarded break too. These corrections follow YAML 1.1 section 6.5 and YAML 1.2.2 section 6.5; both versions use flow folding in example 2.18. Every existing fixture was compared before changing these three values.Validation:
git diff --checkpasses.Exact master merge
a3a5213c7f3b42518f4c8c796a46eaa27e67cba1also passes all 20 jobs in run 37182401871. The stable Linux upload was accepted at the correct destination (11,208 bytes), with all 20 sessions processed at 87.56%.Fixes #241.
Co-authored by Codex
AI disclosure: This work was prepared with assistance from OpenAI Codex.