Skip to content

fix: Loosen validation a bit to account for invalid Markdown#190

Merged
FrederikBolding merged 2 commits intomainfrom
fb/loosen-validation-a-bit
Sep 2, 2025
Merged

fix: Loosen validation a bit to account for invalid Markdown#190
FrederikBolding merged 2 commits intomainfrom
fb/loosen-validation-a-bit

Conversation

@FrederikBolding
Copy link
Copy Markdown
Member

Loosen validation of each line a bit to allow for invalid Markdown to still be parsed correctly.

@FrederikBolding FrederikBolding requested a review from a team as a code owner September 2, 2025 10:33
Comment thread src/build.js
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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal with adjusting the regex was to ensure that the lines still have content. This is intended even though it seems more strict.

@FrederikBolding FrederikBolding merged commit 80087f3 into main Sep 2, 2025
22 checks passed
@FrederikBolding FrederikBolding deleted the fb/loosen-validation-a-bit branch September 2, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants