fix toggle blockquotes

This commit is contained in:
Philipp Kühn
2018-10-10 15:08:37 +02:00
parent 27fa310937
commit fe210f68ed
3 changed files with 22 additions and 6 deletions

View 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)
}
}

View File

@@ -46,6 +46,7 @@ import setInlineBlockType from './commands/setInlineBlockType'
import splitToDefaultListItem from './commands/splitToDefaultListItem'
import toggleBlockType from './commands/toggleBlockType'
import toggleList from './commands/toggleList'
import toggleWrap from './commands/toggleWrap'
import updateMark from './commands/updateMark'
export {
@@ -95,5 +96,6 @@ export {
splitToDefaultListItem,
toggleBlockType,
toggleList,
toggleWrap,
updateMark,
}