Ad Hoc: Fix Markdown Link Rendering in Copilot Streaming Messages (Issue #40)
- Ad Hoc: Fix Markdown Link Rendering in Copilot Streaming Messages (Issue #40)
- Identified root cause: Copilot streaming chunks with markdown links were sent as plain text instead of formatted HTML
- Added
hasMarkdownLinks()helper function to detect markdown links in text chunks using regex pattern - Modified Copilot streaming callback to route chunks with markdown to HTML formatting using existing
sendMarkdownMessage()helper - Created comprehensive test suite to verify markdown detection, HTML formatting, and end-to-end streaming behavior
- Ensured fix is surgical and targeted - only affects Copilot status messages with GitHub links, preserves all existing functionality
- All 106 tests passing, confirming no regressions introduced
- Follow-up: Refactored function naming based on user feedback
- Enhanced existing
sendMarkdownMessage()function to automatically detect markdown content instead of creating newsendMessageSmart()function - Avoided function naming changes to reduce cognitive overhead and merge conflict potential
- Generalized markdown detection to include links, code blocks, bold, italic, and headings
- Replaced all message sending calls to use enhanced smart detection while preserving existing function names
- All 110 tests continue to pass with comprehensive markdown support
- Enhanced existing
Morpheum