State.doc doesn't have to be the schema's top-level node

Just an observation I ran into today: ProseMirror works just fine if you create a state that, for example, has a paragraph as its document node, even if that’s not the schema’s top-level node. This means that if you want to create an editor just for a sub-tree of your document, you don’t even have to create a new schema.

Relatedly, in the next release, it’ll be possible to give your schema’s default top-level node a name other than "doc", so that it can be more descriptive of the thing your documents actually represent.

I’m preparing a 0.18 release, which will hopefully come out this week, but have a few things I still want to implement first.

1 Like