mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 14:13:21 +08:00
refactoring
This commit is contained in:
parent
463d46da8c
commit
add9090d39
@ -7,7 +7,18 @@ declare module '../Editor' {
|
||||
}
|
||||
}
|
||||
|
||||
export default function setContent(next: Function, editor: Editor, content: string, emitUpdate: Boolean = true, parseOptions: any = {}): void {
|
||||
export default function setContent(
|
||||
next: Function,
|
||||
editor: Editor,
|
||||
content = null,
|
||||
emitUpdate = true,
|
||||
parseOptions = {},
|
||||
): void {
|
||||
if (content === null) {
|
||||
next()
|
||||
return
|
||||
}
|
||||
|
||||
const { view, state, createDocument } = editor
|
||||
const { doc, tr } = state
|
||||
const document = createDocument(content, parseOptions)
|
||||
|
Loading…
Reference in New Issue
Block a user