Hello,
I feed some HTML text directly from a database into the document while creating the EditorState:
const state = EditorState.create({
doc: this.parser.parse(this.htmlToElement(this.html)),
plugins: plugins,
});
When pushing the save button I want to get the complete HTML text from the document. Currently I only get the latest bit of the content, by using the following:
getHtmlValue() {
const fragment = DOMSerializer.fromSchema(schema).serializeFragment(this.view.state.doc.content);
return new XMLSerializer().serializeToString(fragment)
}
When i examine the this.view.state.doc.content object it appears to contain fragments for the complete document of which the prosemirror is just a part, how do I easily get just the content in the prosemirror itself?
Mazzel,
Martijn.