Greetings!
I’ve been studying prosemirror for a couple of days now. I think I have a rough grasp of the conceptual entites and how they fit together.
I’m implementing a markdown editor based on the “Friendly markdown” tutorial. All has gone well so far in customising it to be exactly as I want (menu items, in particular).
But I am stuck when trying to prevent users from adding certain node types. (I believe nodes is the correct term). I’ve partly disabled the user from adding headings, images, and ordered and unordered lists by excluding them from the menu, but users can still paste these things in from their clipboard.
I believe that the place to do this is in the schema, so I’ve created a copy of the provided schema (https://github.com/ProseMirror/prosemirror-markdown/blob/master/src/schema.js), and set some properties to false like this:
export const schema = new Schema({
nodes: {
ordered_list: false,
bullet_list: false,
list_item: false,
But I can still paste the unwanted things into the editor.
Is this the correct place to blacklist element types?
I am thinking that maybe I need to join the schema into the editor view somehow?