fix: normalize CRLF line endings in markdown parsers for Windows compatibility#16
Open
blucyk wants to merge 1 commit intobuildermethods:mainfrom
Open
fix: normalize CRLF line endings in markdown parsers for Windows compatibility#16blucyk wants to merge 1 commit intobuildermethods:mainfrom
blucyk wants to merge 1 commit intobuildermethods:mainfrom
Conversation
Markdown files created on Windows use CRLF (\\r\\n) line endings, which caused the regex patterns in parseProductOverview and parseProductRoadmap to fail matching section headers. This fix normalizes line endings to LF (\\n) before parsing, ensuring cross-platform compatibility.
cabana8471-arch
added a commit
to cabana8471-arch/design-os
that referenced
this pull request
Jan 3, 2026
HIGH (1): - Fix validation-patterns.md completeness percentages (8% → 50%) MEDIUM (8): - Add conditional check for --skip-validation warning (buildermethods#2) - Use $RANDOM instead of date +%N for macOS compatibility (buildermethods#3) - Add mkdir -p product/ before context file creation (buildermethods#4) - Increase minimum file size validation to 1000 bytes (buildermethods#9) - Fix grep patterns with trailing space to prevent false matches (buildermethods#10, buildermethods#11) - Align validation-patterns.md percentages with command-reference (buildermethods#16) - Add word count (min 20) and placeholder validation (buildermethods#19) LOW (11): - Remove Mode options table duplication (buildermethods#5) - Remove Question counts table duplication (buildermethods#6) - Update phase file versions to v1.0.1 (buildermethods#7) - Improve variable order documentation (buildermethods#8) - Verify referenced files exist (buildermethods#12) - Add font preferences guidance (buildermethods#13) - Add cross-reference filtering test cases (buildermethods#14) - Document audit+stage interaction with filtered example (buildermethods#15) - Clarify AskUserQuestion multiselect usage (buildermethods#17) - Translate Romanian notes to English (buildermethods#18) - Add minimal question count (~29) to main file (buildermethods#20) Version bumps: - product-interview.md: v1.3.5 → v1.3.6 - All phase files: v1.0.0 → v1.0.1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Great fix, Thanks mate👍 |
rayedriasat
approved these changes
Jan 4, 2026
rayedriasat
left a comment
There was a problem hiding this comment.
Yup, I was facing the same issue on cursor in Windows. This change solved the issue
|
This issue persists with other things too. Such as the last step before exporting, still needs a fix |
|
Hi @blucyk! Thanks for identifying and fixing this CRLF issue - it's a real pain point for Windows users. I wanted to give a heads up that I've submitted #21 which includes this same fix, but extends it further:
Just wanted to provide visibility so the maintainers can decide how to consolidate these changes. Your fix is solid and mine builds on the same approach (normalizing Thanks again for catching this! |
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
Markdown files created on Windows use CRLF (\r\n) line endings, which caused the regex patterns in parseProductOverview and parseProductRoadmap to fail matching section headers.
This fix normalizes line endings to LF (\n) before parsing, ensuring cross-platform compatibility.
Problem
Using Cursor on Windows, markdown files (
product-overview.md,product-roadmap.md) are saved with CRLF (\r\n) line endings. The regex patterns inparseProductOverviewandparseProductRoadmapuse\nto match newlines, causing the patterns to fail on Windows systems.This results in the Sections page showing "No roadmap defined yet" even when
product-roadmap.mdexists and is properly formatted.Solution
Added line ending normalization (
md.replace(/\r\n/g, '\n')) at the start of both parser functions before regex matching. This ensures cross-platform compatibility without changing the regex patterns.Documented steps to test
/product-visionto createproduct/product-overview.md/product-roadmapto createproduct/product-roadmap.mdwith 3+ sectionsgit ls-files --eol | grep productnpm run dev/sections)Notes for reviewers
(Sorry for not opening a discussion, just wanted to quickly pass along the fix I used to get past my issue)