Repository navigation
Fix: read the YAML layouts real dashboard configs use - #33
Merged
Merged
Conversation
Three constructs refused a whole file, and between them they blocked most real configs, including the default one Dashy ships. A sequence written level with the key it belongs to is now read as that key's value. Only a sequence may do this; a mapping at the same column is the next key of the same parent. This is the common way of writing YAML and it also covers a Homepage group nested by two spaces. A block scalar is folded or kept literally, with chomping. Its body is consumed while scanning, so a list dash, a comment marker or a tab inside it is text rather than structure. Long API keys and icon URLs are wrapped this way. An empty flow collection reads as an empty list or mapping. One with contents still refuses, which is where parsing it would start to guess. Checked against js-yaml on fourteen real files: every one that both accept parses identically.
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
navLinks; a mapping at the same column stays the parent's next key. This also covers a Homepage group nested by two spaces rather than four.[]and{}as an empty list and mapping. A flow collection with contents still refuses, since parsing that is where guessing would start.Testing
All green: 1092 backend, 618 frontend, 94.8% line coverage, lint, format, both typechecks,
paths:checkand cache-busting. Checked against js-yaml on fourteen real files, ten community and official Dashy configs plus a real four-file gethomepage setup: every file both parsers accept parses identically, and the one refusal left is an Ansible template that js-yaml rejects too. Before this, eight of eleven Dashy configs and the gethomepage services file were refused outright.Checklist