mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-25 21:19:06 +08:00
refactoring
This commit is contained in:
parent
5f740da53e
commit
d089259080
@ -8,11 +8,7 @@ export default function (pos, type, attrs = {}) {
|
||||
}
|
||||
|
||||
if (dispatch) {
|
||||
// const transform = state.tr
|
||||
// .replaceWith(pos.from, pos.to, state.schema.nodes.mention.create({ id: 2, type: 'user', label: 'loool' }))
|
||||
const transform = state.tr.replaceWith(pos.from, pos.to, type.create(attrs))
|
||||
|
||||
dispatch(transform)
|
||||
dispatch(state.tr.replaceWith(pos.from, pos.to, type.create(attrs)))
|
||||
}
|
||||
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user