mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-25 21:35:53 +08:00
refactoring
This commit is contained in:
parent
5f740da53e
commit
d089259080
@ -8,11 +8,7 @@ export default function (pos, type, attrs = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dispatch) {
|
if (dispatch) {
|
||||||
// const transform = state.tr
|
dispatch(state.tr.replaceWith(pos.from, pos.to, type.create(attrs)))
|
||||||
// .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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user