fix toggle blockquotes
This commit is contained in:
14
packages/tiptap-commands/src/commands/toggleWrap.js
Normal file
14
packages/tiptap-commands/src/commands/toggleWrap.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { wrapIn, lift } from 'prosemirror-commands'
|
||||
import { nodeIsActive } from 'tiptap-utils'
|
||||
|
||||
export default function (type) {
|
||||
return (state, dispatch, view) => {
|
||||
const isActive = nodeIsActive(state, type)
|
||||
|
||||
if (isActive) {
|
||||
return lift(state, dispatch)
|
||||
}
|
||||
|
||||
return wrapIn(type)(state, dispatch, view)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user