2.3 KiB
2.3 KiB
GitHub Issue #483 Fix - Changes Summary
Issue: Generated story Markdown deviates from GFM/CommonMark (CRLF & whitespace) — breaks automated edits on Windows
Files Created/Modified for Fix
Core Solution Files
src/utility/markdown-formatter.js- Main MarkdownFormatter class with Windows CRLF supportsrc/utility/workflow-output-formatter.js- Integration module for workflow template processingsrc/utility/WORKFLOW-MARKDOWN-INTEGRATION.md- Developer integration guide
Test Files
test/markdown-formatting-tests.js- Detection tests for markdown issuestest/test-markdown-formatter.js- Main test runner for the formatter utilitytest/run-markdown-tests.js- Alternative test runner scripttest/fixtures/markdown-issues/- Test fixture files with problematic markdown samplescrlf-mixed.md- Mixed line ending test casespacing-issues.md- Trailing whitespace test casesmart-quotes.md- Smart quotes conversion test caseheading-hierarchy.md- Heading level hierarchy test caseqa-results-exact-match.md- String matching test case
Configuration Files
.editorconfig- Project-wide line ending and whitespace settings.remarkrc.json- Markdown linting configuration.remarkignore- Files to ignore during markdown lintingeslint.config.mjs- Updated ESLint config to allow CommonJS in utility modulespackage.json- Added new npm scripts for markdown testing and linting
Key Features Implemented
- Windows CRLF Support: Properly converts line endings for Windows compatibility
- Smart Whitespace Handling: Removes trailing whitespace while preserving code blocks
- GFM Compliance: Enforces GitHub Flavored Markdown standards
- Workflow Integration: Automatic formatting for template-generated content
- Comprehensive Testing: Validates all edge cases mentioned in the issue
Test Results
- ✅ All 5 markdown formatter test cases pass
- ✅ ESLint: 0 errors
- ✅ Prettier: All files formatted correctly
- ✅ Core issue resolved: CRLF/whitespace problems fixed
Dependencies Added
remark- Markdown processorremark-lint- Markdown lintingremark-preset-lint-recommended- Recommended linting rulesremark-cli- Command line interface for remark
Date: October 26, 2025 Fix Status: Complete and Tested