mdx-editor / editor

A rich text editor React component for markdown
https://mdxeditor.dev
MIT License
1.78k stars 138 forks source link

[BUG] ChangeAdmonitionType plugin throws when it's included #322

Open dave-db opened 7 months ago

dave-db commented 7 months ago

Describe the bug Adding the ChangeAdmonition type plugin to the active plugin list throws TypeError: Cannot read properties of null (reading 'rootNode')

Reproduction codesandbox

To Reproduce Steps to reproduce the behavior: Load the sandbox

Expected behavior No error!

Desktop (please complete the following information): MacOS, Chrome 119, mdx-editor 2.3.4

petyosi commented 7 months ago

The ChangeAdmonition component needs some specific setup to work as expected. See how it's setup in the KitchenSinkToolbar. https://github.com/mdx-editor/editor/blob/main/src/plugins/toolbar/components/KitchenSinkToolbar.tsx

This should be documented better of course. I would appreciate a PR, there's so much work in the details here.

dave-db commented 7 months ago

Grand, thank you. Let me see if I can help with a PR on this.