List available nodes and marks

I have scoured the documentation and source. I can’t find a definitive list of a available nodes or marks. Is there a way to programmatically list all nodes and marks?

Thanks, Bryce

There is no single schema, since the library allows you define your own, and as such, there is no definite set of nodes and marks. Packages like prosemirror-schema-basic define a specific schema with a specific set of nodes and marks. You can look at Schema.nodes/Schema.marks to dynamically see which nodes and marks are defined in a schema object.

For those that find this later, all those nodes and marks are defined here: https://github.com/ProseMirror/prosemirror-schema-basic/blob/master/src/schema-basic.ts

Thanks for the help!

1 Like

And other non “basic” here but still library code: https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.ts