Skip to content

feat(MDX): add optional hard breaks option#1406

Open
eaglethrost wants to merge 2 commits intonextfrom
dimas/cx-2095-line-break-characters-in-descriptions-arent-being-processed
Open

feat(MDX): add optional hard breaks option#1406
eaglethrost wants to merge 2 commits intonextfrom
dimas/cx-2095-line-break-characters-in-descriptions-arent-being-processed

Conversation

@eaglethrost
Copy link
Copy Markdown
Contributor

@eaglethrost eaglethrost commented Mar 27, 2026

🎫 Resolve CX-2095

Summary

  • Adds an optional hardBreaks flag to the MDX compile() function that enables remark-breaks, converting soft line breaks (\n) into hard breaks (<br>)
  • This would allow text like hello \n there to be split now
  • Disabled by default to preserve existing behavior, different app components can opt in as needed

Context

The legacy rendering engine parsed newline characters as line breaks. Some customers want this behaviour in refactored, such as in API descriptions in the API explorer (see attached linear ticket), hence we should have an option in the MDX rendering to allow that. See also this linear comment: https://linear.app/readme-io/issue/CX-2095/line-break-characters-in-descriptions-arent-being-processed-correctly#comment-a6580c9e

If we agree to do this, we would need to also update the readme side to use the new flag for UI areas that need this behaviour.

@eaglethrost eaglethrost changed the title feat: add optional hard breaks support to MDX compile feat(MDX): add optional hard breaks option Mar 27, 2026
@eaglethrost eaglethrost marked this pull request as draft March 27, 2026 12:36
@eaglethrost eaglethrost marked this pull request as draft March 27, 2026 12:36
@eaglethrost eaglethrost marked this pull request as ready for review March 27, 2026 12:55
@eaglethrost eaglethrost requested review from rafegoldberg and removed request for rafegoldberg March 27, 2026 12:55
@eaglethrost eaglethrost requested a review from rafegoldberg April 7, 2026 13:21
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