fix: Loosen validation a bit to account for invalid Markdown#190
Merged
FrederikBolding merged 2 commits intomainfrom Sep 2, 2025
Merged
fix: Loosen validation a bit to account for invalid Markdown#190FrederikBolding merged 2 commits intomainfrom
FrederikBolding merged 2 commits intomainfrom
Conversation
| segments.length === 4 && | ||
| /^\|\s*\d+\s*\|\s*0x[a-z0-9]+\s*\|/iu.test(line) | ||
| segments.length >= 4 && | ||
| /^\|\s*\d+\s*\|\s*0x[a-z0-9]+\s*\|\s.+\|\s.+\|?$/iu.test(line) |
There was a problem hiding this comment.
Bug: Regex Update Breaks Existing Data Parsing
The new regex pattern for parsing slip44.md uses \s.+ for symbol and name fields, requiring at least one whitespace and one character. This makes validation stricter, preventing parsing of valid entries with empty or whitespace-only symbols/names, which contradicts the goal of loosening validation and breaks existing data. Additionally, the regex, combined with slice(1) and segments.length >= 4, could incorrectly parse lines containing extra | characters within content fields.
Member
Author
There was a problem hiding this comment.
The goal with adjusting the regex was to ensure that the lines still have content. This is intended even though it seems more strict.
Mrtenz
approved these changes
Sep 2, 2025
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.
Loosen validation of each line a bit to allow for invalid Markdown to still be parsed correctly.