Remark-Breaks not behaving as intended #1095
-
I'm using <ReactMarkdown
remarkPlugins={[remarkGfm, remarkBreaks]}
rehypePlugins={[rehypeRaw]}
components={{
a: ({ node, ...props }) => <a target="_blank" {...props} />,
code: ({ inline, className, children }) => CodeBlock({ inline, className, children }),
}}
>
{post.content}
</ReactMarkdown> With an input of
I expect an output of <p>Hello</p>,
<br />
<br />
<br />
<p>world!</p> However, I instead receive an output of <p>Hello</p>
<p>world!</p> I've tried with/without rehypeRaw as well as remarkBreaks, and get the same behavior regardless. Could someone point me in the right direction to get the plugin working properly? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I don’t know what you mean by multiple new lines not being interpreted as multiple new lines. Please provide that input, the current actual output, and the expected output. |
Beta Was this translation helpful? Give feedback.
-
https://codesandbox.io/s/newline-problem-rh98l5?file=/src/App.js Here is a reproduction for this issue. I believed Remark-Breaks should be able to solve this issue, but not. |
Beta Was this translation helpful? Give feedback.
I don’t know what you mean by multiple new lines not being interpreted as multiple new lines. Please provide that input, the current actual output, and the expected output.