-
-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'break' not working in v3 #105
Comments
It follows the "spec" in this regard; a hard break needs two or more spaces as the end of a line, followed by a newline character. If you want it to insert a break for each newline character, you can do that through a plugin. I've just released v3.0.1 with experimental plugin support. So in your case, you could install remark-breaks and do the following: const React = require('react')
const ReactDOM = require('react-dom')
const Markdown = require('react-markdown')
const breaks = require('remark-breaks')
const input = `break
me
at
every
line`
ReactDOM.render(
<Markdown source={input} plugins={[breaks]} />,
document.getElementById('root')
) Which would output something along the lines of: <p>break<br />me<br />at<br />every<br />line</p> |
Just for your information, the newline character which appears in the very beginning of content, does not render I had to append a space to make it work. |
Not sure if this one is fixable:
Renders:
|
When allowing all types or specifically 'break' in v3, it will not add BR breaks. This also does not work in the demo which allows all types.
I expected the same behaviour as 'SoftBreak' in v2 (although the naming is confusing...), where single enters end up as a BR and multiple end up as P. The 'SoftBreak' features seems to have been removed however.
The text was updated successfully, but these errors were encountered: