Skip to content

Conversation

@blucyk
Copy link

@blucyk blucyk commented Jan 1, 2026

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 in parseProductOverview and parseProductRoadmap use \n to 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.md exists 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

  1. Create a new Design OS project (in Cursor?) on Windows
  2. Run /product-vision to create product/product-overview.md
  3. Run /product-roadmap to create product/product-roadmap.md with 3+ sections
  4. Verify files have CRLF line endings: git ls-files --eol | grep product
  5. Start the dev server: npm run dev
  6. Navigate to the Sections page (/sections)
  7. Verify all roadmap sections display correctly (not "No roadmap defined yet")
  8. Both parsers now correctly parse files regardless of line ending format

Notes for reviewers

(Sorry for not opening a discussion, just wanted to quickly pass along the fix I used to get past my issue)

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 <noreply@anthropic.com>
@unrayed
Copy link

unrayed commented Jan 3, 2026

Great fix, Thanks mate👍

Copy link

@rayedriasat rayedriasat left a comment

Choose a reason for hiding this comment

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

Yup, I was facing the same issue on cursor in Windows. This change solved the issue

@unrayed
Copy link

unrayed commented Jan 4, 2026

This issue persists with other things too. Such as the last step before exporting, still needs a fix

@lutfi-zain
Copy link

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:

  • CRLF normalization across all loaders (product-loader, data-model-loader, design-system-loader, shell-loader) - as @unrayed mentioned, the issue persists in other places too
  • Switched from build-time import.meta.glob to runtime fetch() - this enables hot-reload of product files without restarting the dev server
  • Added useProductData hook for consistent async loading pattern
  • Added loading states to all affected pages

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 \r\n to \n before parsing).

Thanks again for catching this!

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.

4 participants