feat(MDX): add optional hard breaks option#1406
Conversation
erunion
left a comment
There was a problem hiding this comment.
this lgtm but would love a second approval from @rafegoldberg or @dannobytes
|
@eaglethrost will this option make it match Xish? |
|
Not a huge fan of adding any extra flags or optional behavior unless it's absolutely one thousand percent necessary. |
Yes it will, and legacy as well
Yeah honestly I think we're doing this just because a customer wants the behaviour. I don't think we should make it the default as it will affects thousands of documents unexpectedly, hence why I made it an option. I think this is more of a business decision, on the technical side it works but just not the cleanest. Deferring decision to you @rafegoldberg 🙏 So if we were to go with this and address the ticket, we would need a monorepo side change to set on this new flag for RDMD components in the API Explorer Description Field only, to keep the blast radius low. Now MDX (left) would match legacy / Xish (right)
|
…iptions-arent-being-processed

Summary
hardBreaksflag to the MDXcompile()function that enablesremark-breaks, converting soft line breaks (\n) into hard breaks (<br>)hello \n thereto be split nowContext
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.