mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-29 08:19:34 +08:00
fix getHTML function. do not export decorations
This commit is contained in:
parent
111b9cab2e
commit
3fa5a6e7f1
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user