add topNode option

This commit is contained in:
Philipp Kühn 2019-06-27 20:02:13 +02:00
parent 54ae2d4a17
commit 0883b01198

View File

@ -33,6 +33,7 @@ export default class Editor extends Emitter {
autoFocus: null, autoFocus: null,
extensions: [], extensions: [],
content: '', content: '',
topNode: 'doc',
emptyDocument: { emptyDocument: {
type: 'doc', type: 'doc',
content: [{ content: [{
@ -181,6 +182,7 @@ export default class Editor extends Emitter {
createSchema() { createSchema() {
return new Schema({ return new Schema({
topNode: this.options.topNode,
nodes: this.nodes, nodes: this.nodes,
marks: this.marks, marks: this.marks,
}) })