add blockquote commands
This commit is contained in:
@@ -4,13 +4,13 @@ import { Command } from '../types'
|
||||
import nodeIsActive from '../utils/nodeIsActive'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
|
||||
export default (typeOrName: string | NodeType, attrs = {}): Command => ({ state, dispatch }) => {
|
||||
export default (typeOrName: string | NodeType, attributes = {}): Command => ({ state, dispatch }) => {
|
||||
const type = getNodeType(typeOrName, state.schema)
|
||||
const isActive = nodeIsActive(state, type, attrs)
|
||||
const isActive = nodeIsActive(state, type, attributes)
|
||||
|
||||
if (isActive) {
|
||||
return lift(state, dispatch)
|
||||
}
|
||||
|
||||
return wrapIn(type, attrs)(state, dispatch)
|
||||
return wrapIn(type, attributes)(state, dispatch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user