Closed masudhossain closed 1 month ago
I'm pretty sure what is happening here is that you need to extend the base paragraph extension and say whitespace: 'pre'
to actually preserve the whitespace, otherwise, normal HTML rules apply and whitespace is removed.
In general you should be using hardbreaks, not relying on newline behaviour: https://tiptap.dev/docs/editor/extensions/nodes/hard-break
Have you solved the problem?
Affected Packages
@tiptap/react
Version(s)
^2.8.0
Bug Description
If you have content like
hello \n world
and you type in the editor, it will remove the\n
. Including the code below will make it appear the first time in the editor properly, but after that it will remove them.Browser Used
Chrome
Code Example URL
No response
Expected Behavior
To prever the
\n
in the content state.Additional Context (Optional)
Here's the entire block of code:
Dependency Updates