Skip to content

Add remark-breaks so Streamdown matches documented line breaks#382

Open
xhuajin wants to merge 2 commits intovercel:mainfrom
xhuajin:main
Open

Add remark-breaks so Streamdown matches documented line breaks#382
xhuajin wants to merge 2 commits intovercel:mainfrom
xhuajin:main

Conversation

@xhuajin
Copy link

@xhuajin xhuajin commented Feb 9, 2026

Description

Add remark-breaks to the default remark plugin set so single line breaks render as <br> per the docs.

The documentation mentions that GFM preserves line breaks, but my tests show GFM does not retain line breaks. Line breaks in Streamdown are also merged into a single line. I added remark-breaks to preserve line breaks.

https://streamdown.ai/docs/gfm#line-breaks
https://github.com/remarkjs/remark-breaks

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Changes Made

Add remark-breaks to the default remark plugin set so single line breaks render as <br> per the docs.

Testing

  • All existing tests pass
  • Added new tests for the changes
  • Manually tested the changes

Test Coverage

Screenshots/Demos

remark-gfm dosen't preserves the breaks.

图片

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have created a changeset (pnpm changeset)

Changeset

  • I have created a changeset for these changes

Additional Notes

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedremark-breaks@​4.0.01001009983100

View full report

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.

1 participant