prevents invalid content in toggleList
This will skip the replace step for invalid content and instead inserts a new list of selected type
This commit is contained in:
@@ -23,7 +23,7 @@ export default function toggleList(listType, itemType) {
|
|||||||
return liftListItem(itemType)(state, dispatch, view)
|
return liftListItem(itemType)(state, dispatch, view)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isList(parentList.node, schema)) {
|
if (isList(parentList.node, schema) && listType.validContent(parentList.node.content)) {
|
||||||
const { tr } = state
|
const { tr } = state
|
||||||
tr.setNodeMarkup(parentList.pos, listType)
|
tr.setNodeMarkup(parentList.pos, listType)
|
||||||
if (dispatch) dispatch(tr)
|
if (dispatch) dispatch(tr)
|
||||||
|
|||||||
Reference in New Issue
Block a user