fix getHTML function. do not export decorations

This commit is contained in:
Philipp Kühn 2018-09-11 23:06:58 +02:00
parent 111b9cab2e
commit 3fa5a6e7f1

View File

@ -1,6 +1,6 @@
import { EditorState, Plugin } from 'prosemirror-state'
import { EditorView } from 'prosemirror-view'
import { Schema, DOMParser } from 'prosemirror-model'
import { Schema, DOMParser, DOMSerializer } from 'prosemirror-model'
import { gapCursor } from 'prosemirror-gapcursor'
import { keymap } from 'prosemirror-keymap'
import { baseKeymap } from 'prosemirror-commands'
@ -226,7 +226,14 @@ export default {
},
getHTML() {
return this.view.dom.innerHTML
const div = document.createElement('div')
const fragment = DOMSerializer
.fromSchema(this.schema)
.serializeFragment(this.state.doc.content)
div.appendChild(fragment)
return div.innerHTML
},
getJSON() {