How to add line breaks for newlines?
See original GitHub issueIs there an option to add line breaks for newlines when the user presses “enter” in the markdown?
I tried converting all newlines \n
to <br>
but it seems to break parsing in other places.
marked
has a breaks
option to allow this: https://github.com/markedjs/marked/
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:6
Top Results From Across the Web
Add line breaks - Line tools - Unit conversion
Add line breaks where there are none by following these steps. See the example following. 1. Enter or paste information into the window...
Read more >Add or move line breaks - adjust the line length online
Online tool for adding line breaks to change the length of lines with many setting options - fast and flexible.
Read more >The Dos and Don'ts of Adding an HTML Line Break
To do a line break in HTML, use the <br> tag. Simply place the tag wherever you want to force a line break....
Read more >Handle line breaks (newlines) in Python - nkmk note
This article describes how to handle strings including line breaks (line feeds, new lines) in Python. Create a string containing line breaks.
Read more >Line breaks and blank spaces - Overleaf, Online LaTeX Editor
The most standard way how to break lines is to create a new paragraph. This is done by leaving an empty line in...
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 Free
Top 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
I’d toyed with just adding a trailing double space which also works. For now I am passing the content through the following function before passing to markdown-to-jsx:
So that this text:
Renders as:
Test 1 Test Test 3
Test 4
Instead of as:
Test 1 Test Test 3 Test 4 * Test bullet 1 * Test bullet 2
code block situation