TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
6.33k stars 434 forks source link

MantineProvider not provided CSP nonce #997

Open instanceofnull opened 1 month ago

instanceofnull commented 1 month ago

Describe the bug

If a nonce has been passed to the component, it is not forwarded to the MantineProvider (as getStyleNonce). This results in the mantine styles not being applied - and the slash menu does not look right.

image

To Reproduce

The difficult part to reproducing this issue is setting up a strict content security policy - default-src 'none'; script-src 'self'; style-src 'self';

Once that is in place, a simple editor will trigger the issue (open the slash menu to see strange styles) -

<BlockNoteView nonce={context.nonce} editor={editor} filePanel={false} slashMenu={false} editable={editable} theme={lightDefaultTheme} />

Misc

YousefED commented 3 weeks ago

Thanks @instanceofnull . Would gladly accept a PR for this!