Repository navigation
Conversation
A comment between a key and its block list made the look-ahead see the comment, so the key stayed null and the first item errored as a list item without a key. Skip blank and comment lines when looking for the list. Fixes TMHSDigital#84 Signed-off-by: bfs2021 <101915083+bfs2021@users.noreply.github.com>
Owner
|
Thank you for this, and for the tests. #124 merged this morning with the same fix for #84 (opened before this PR could be reviewed), so this branch now conflicts with main and the issue is closed. I compared the two line by line and main covers everything here, so I am closing this as superseded rather than asking for a rebase. Contributions are welcome on any of the remaining open issues. |
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.
Problem
A comment (or blank line) between a key and its block list makes the parser store the key as
nulland report the first item aslist item without a key above it. The error points at the item, not the comment, so contributors are sent to the wrong line.Fix
When a key has no inline value, skip blank and
#lines before checking whether the next content line starts a block list. The comment itself is still ignored by the main loop, so lists interrupted by comments keep working.Testing
Added assertions for the example above:
tagsbecomes["low-poly"]and no errors are reported. They failed before the change and pass after it.npm test→ checks 134 assertions across 22 checks, lib 406 assertions.Fixes #84