I have a question about the following part of the documentation, which describes how to setup a basic editor:
var schema = require("prosemirror-schema-basic").schema
// ...
var state = EditorState.create({
doc: schema.parseDOM(document.getElementById("content"))
})
Here, I’m getting an error saying that parseDOM is not a member of schema.
I’ve been grepping through the source code and it’s actually quite difficult to find a definition for the parseDOM function…
So perhaps somebody can help me out.
Also, I’m wondering how to set the contents of an existing editor with html (basically to swap-in a new state). Does this have to go through a transform? Or can the state be set directly? (I don’t need this operation recorded in a history, or as a part of collaborative editing). Of course, I could create a new editor/view from scratch, but perhaps there is a better way to do this.
Thanks!