Missing converted line breaks in rich-text-html-renderer
See original GitHub issueWhen I’m using the rich-text-html-renderer I expect that also the line breaks are converted to HTML
also. Currently when I’ve some manual line breaks in a paragraph they are ignored completely.
Line1
Line2
should be converted to
<p>
Line1<br />
Line2
</p>
Issue Analytics
- State:
- Created 4 years ago
- Comments:17
Top Results From Across the Web
[LEX] Rich Text Area in Merge Field Fails to Render Line ...
Notice that the line breaks are missing. Workaround Enter the text in Salesforce Classic in order to render the line breaks. Reported By...
Read more >How do I preserve line breaks when getting text from a textarea?
Line breaks actually are preserved, the target element is just set to ignore them while displaying the text but if you inspect it...
Read more >How to insert line break into Rich Text field from Field Update
I've tried using BR() to insert line breaks but I don't see that line break when viewing the standard detail page for the...
Read more >Line breaks on the Rich Text editor - Contentful Community
I'm using contentful with Next.js. My first attempt was using a long text field with markdown, then converting the markdown to HTML with...
Read more >Line breaks in Text(64000) fields not recognized in html block ...
As a workaround, we can use a Formula field in our table to replace the string line breaks with HTMl <br> tag so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@quinnmyers The above comments and examples are mainly referring to
using rich-text-html-renderer
, notrich-text-react-renderer
. That’s why these examples usenext
rather thanchildren
.The documentation for
rich-text-react-renderer
actually gives an example for how to use therenderText
option to replace\n
line breaks with<br />
.Try using this
options
definition:You can see a working example on codesandbox.io.
Thank you, @sbezludny for your code snipped above. It helped us allot See
I enhenced it a little bit, because your example stripped away the
<p />
and only converted the first\n'
into<br />
Maybe this is helpful for others as well