don't insert extra lines when upload photos
This commit is contained in:
parent
7863a4232d
commit
a53fb49ec3
|
@ -311,12 +311,12 @@ const useUploadMutation = (editor: Editor | null) =>
|
||||||
{
|
{
|
||||||
onSuccess(urls) {
|
onSuccess(urls) {
|
||||||
if (!editor) return
|
if (!editor) return
|
||||||
let trans = editor.view.state.tr
|
let trans = editor.chain().focus()
|
||||||
urls.forEach((src: any) => {
|
urls.forEach((src) => {
|
||||||
const node = editor.view.state.schema.nodes.image.create({ src })
|
trans = trans.createParagraphNear()
|
||||||
trans = trans.insert(editor.view.state.selection.to, node)
|
trans = trans.setImage({ src })
|
||||||
})
|
})
|
||||||
editor.view.dispatch(trans)
|
trans.run()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user