BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

MantineProvider not provided CSP nonce

Open instanceofnull opened this issue 1 year ago • 1 comments

Describe the bug

If a nonce has been passed to the <BlockNoteView> 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

  • Node version: v20.9.0
  • Package manager: yarn v1.22.19
  • Browser: Chrome

instanceofnull avatar Aug 09 '24 04:08 instanceofnull

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

YousefED avatar Aug 23 '24 11:08 YousefED