fix: add way to cancel inputrules and pasterules (#2368)
Co-authored-by: Philipp Kühn <philippkuehn@MacBook-Pro-von-Philipp.local>
This commit is contained in:
@@ -24,7 +24,7 @@ export function markPasteRule(config: {
|
||||
const attributes = callOrReturn(config.getAttributes, undefined, match)
|
||||
|
||||
if (attributes === false || attributes === null) {
|
||||
return
|
||||
return null
|
||||
}
|
||||
|
||||
const { tr } = state
|
||||
@@ -64,6 +64,8 @@ export function markPasteRule(config: {
|
||||
|
||||
tr.removeStoredMark(config.type)
|
||||
}
|
||||
|
||||
return tr
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -29,7 +29,11 @@ export function textPasteRule(config: {
|
||||
}
|
||||
}
|
||||
|
||||
state.tr.insertText(insert, start, end)
|
||||
const { tr } = state
|
||||
|
||||
tr.insertText(insert, start, end)
|
||||
|
||||
return tr
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user