Unable to set whiteSpace
style on NodeViewWrapper
& NodeViewContent
#2883
Labels
Type: Bug
The issue or pullrequest is related to a bug
What’s the bug you are facing?
Passing
whiteSpace
in thestyle
prop ofNodeViewWrapper
andNodeViewContent
elements doesn't work.Rendered HTML:
Rendered HTML:
Which browser was this experienced in? Are any special extensions installed?
Nothing special.
How can we reproduce the bug on our side?
Attempt to pass
whiteSpace: "pre"
in thestyle
prop ofNodeViewContent
&NodeViewWrapper
in@tiptap/react
.For example:
And you'll see the
white-space
style on the rendered HTML elements won't be set topre
.Can you provide a CodeSandbox?
https://codesandbox.io/s/intelligent-wildflower-wt6zb8?file=/src/Editor/CodeBlockComponent.test.js
The CodeSandbox example is the same as the React example from https://tiptap.dev/examples/syntax-highlighting, but with the
style
prop being declared on theNodeViewWrapper
andNodeViewContent
elements, as shown:If you run the tests, it'll say that has the 2 color styles are set as
red
/blue
, but notwhite-space: pre
styling.What did you expect to happen?
For it the
whiteSpace
style to reflect on the rendered HTML.Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: