In this page we answer a list of commonly asked things
Create a plugin that watches changes to the editor, see exporting data for an example.
Create a plugin which listens to DOM events as show below:
💡 See Prosemirror.EditorProps for the API.
📖 See Keybindings Guide
If you are using the vanilla setup, you can get access to
view from the editor instance. For example
In a React setup you can get the
view from the hook useEditorViewContext for components rendered inside the
<BangleEditor />. For components
<BangleEditor />, save the
editor in your applications state management for retrieval and access. Don't forget to clean it up when your editor is destroyed.
How do I get access to the
dispatch for a command?#
### How do I execute a command ? above.
If you are using
specs:[ ... ] notation, switch to using SpecRegistry.
How do I access
prosemirror-* module ?#
You can either npm install them:
or use the ones provided in bangle core which follow the path of
I recommend the later approach to avoid problems with different versions of Prosemirror existing in your application.
This is a pretty heavy question as this requires Prosemirror knowledge of dealing with
transactions. To get started read up on
- Read the Prosemirror guide at least 3 times.
- Browse the source code of some of your favourite components to get a hang of carrying out transactions.
- Checkout prosemirror-utils for more code examples.
Below is an example of how you can create a new paragraph node: