Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented Sep 10, 2025

Saw this show up in the new thinking output


Important

Add remark-breaks plugin to render line breaks in markdown content in MarkdownBlock.tsx.

  • Behavior:
    • Add remark-breaks to remarkPlugins in MarkdownBlock.tsx to render line breaks in markdown content.
  • Dependencies:
    • Add remark-breaks to dependencies in package.json.

This description was created by Ellipsis for 4941b92. You can customize this summary. It will automatically update as commits are pushed.

@mrubens mrubens requested review from cte and jr as code owners September 10, 2025 19:47
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. UI/UX UI/UX related or focused labels Sep 10, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Sep 10, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I've reviewed the changes and have some suggestions for improvement. The implementation looks clean and follows the existing pattern for adding remark plugins.

import rehypeKatex from "rehype-katex"
import remarkMath from "remark-math"
import remarkGfm from "remark-gfm"
import remarkBreaks from "remark-breaks"
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a brief comment explaining why this plugin was added, for future maintainers:

Suggested change
import remarkBreaks from "remark-breaks"
import remarkBreaks from "remark-breaks" // Converts line breaks in markdown to <br> tags for better rendering in thinking output

remarkPlugins={[
remarkGfm,
remarkMath,
remarkBreaks,
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a test case for line break rendering in the existing test file at webview-ui/src/components/common/__tests__/MarkdownBlock.spec.tsx. This would help ensure the remark-breaks plugin works as expected and prevent regressions.

For example:

it('should render line breaks correctly with remark-breaks', async () => {
  const markdown = 'First line\nSecond line\nThird line';
  const { container } = render(<MarkdownBlock markdown={markdown} />);
  
  // Wait for content to be processed
  await screen.findByText(/First line/, { exact: false });
  
  // Check that line breaks are rendered as <br> tags
  const brElements = container.querySelectorAll('br');
  expect(brElements.length).toBe(2);
});

Also, I noticed that the p tag styling already has white-space: pre-wrap (line 119), which preserves line breaks. Could this potentially conflict with or duplicate the behavior of remark-breaks? It might be worth verifying that these two approaches work well together.

@mrubens mrubens closed this Sep 10, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 10, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Sep 10, 2025
@daniel-lxs daniel-lxs deleted the remark_breaks branch September 10, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants