refactoring

This commit is contained in:
Philipp Kühn
2020-09-22 15:22:24 +02:00
parent 119fdd0dff
commit 8ca8e041fd
4 changed files with 8 additions and 37 deletions

View File

@@ -25,8 +25,7 @@ function selectionToInsertionEnd(tr: Transaction, startLen: number, bias: number
tr.setSelection(Selection.near(tr.doc.resolve(end as unknown as number), bias))
}
export const insertHTML: InsertHTMLCommand = value => ({ tr, editor }) => {
const { state } = editor
export const insertHTML: InsertHTMLCommand = value => ({ tr, state }) => {
const { selection } = tr
const element = elementFromString(value)
const slice = DOMParser.fromSchema(state.schema).parseSlice(element)