If you’re wanting to customize the schema, you’re probably ready to move away from using
prosemirror-schema-basic directly. You can use that module as the basis for your new document and build from there. Once you master it, modifying your schema is one of the most enjoyable parts of using ProseMirror.
Start by looking at the source for
prosemirror-schema-basic and you’ll notice that it’s just a single file about 150 lines long: prosemirror-schema-basic/schema-basic.js at master · ProseMirror/prosemirror-schema-basic · GitHub
In fact, many of those lines are comments. Use that structure as the basis for your new schema. If you’re wanting to remove images, find the
nodes dictionary and remove the
image entry. That’s it!
doc node is your top-level node type for the whole document. In this case the document simply contains one or more
block nodes. There is no node type called
block, but several node types have
From there you can move on to modifying
marks (e.g. you could remove “bold” functionality by removing the
strong mark or add a new
The important idea here is that you’re not modifying your document schema at runtime unless you have a really good reason to do so and you understand the implications of doing so. Otherwise, don’t be afraid to dig into the details.