The official tutorial shows how to set the initial text content of a text box by setting the doc
property when creating an EditState
.
let content = document.getElementById("content")
let view = new EditorView(document.body, {
state: EditorState.create({
doc: DOMParser.fromSchema(schema).parse(content)
}),
});
My question is, can this process be implemented through Plugin
.
for example:
let initDocPlugin = new Plugin({})
let view = new EditorView(document.body, {
state: EditorState.create({
schema: schema,
plugins: [initDocPlugin],
}),
});