-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix: Support Remark Line Breaks in Agent Response #6818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the RenderMarkdown component to always use remarkBreaks plugin for all markdown content (both user messages and model responses), removing the conditional logic that previously applied it only to user messages. This ensures consistent line break handling across all message types.
Key Changes
- Applied
remarkBreaksplugin unconditionally to all markdown content regardless ofisUserprop value - Simplified the
remarkPluginsmemoization by removing the dependency onisUser - Added comprehensive test coverage for line break preservation in various scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| web-app/src/containers/RenderMarkdown.tsx | Removed conditional remarkBreaks application, now always included in the plugin array |
| web-app/src/containers/tests/RenderMarkdown.test.tsx | Added new test file with 4 test cases covering line break handling for model responses, user messages, different line endings, and empty lines |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This looks good, pls help to fix the tests and resolve latest conflicts, then we can have your PR merged. Thanks @bytrangle |
louis-jan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Describe Your Changes
There have been various reports of new lines not being rendered in model response. I think this issue comes from the
RenderMarkdowncomponent.remark-breaks, the Remark plugin that supports line breaks is only added when propisUseris true.isUseris only passed as true for user message. For model response, this prop is not passed toRenderMarkdownsoisUseris undefined, thus preventingremark-breaksfrom working.Fixes Issues
Self Checklist