Skip to content

Commit

Permalink
fix: conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
gethari committed Feb 13, 2023
1 parent 0ee1515 commit f82c85c
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions packages/core/src/commands/toggleList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,22 @@ export const toggleList: RawCommands['toggleList'] = (listTypeOrName, itemTypeOr
return (
chain()
// try to convert node to default node if needed
.command(() => {
const canWrapInList = can().wrapInList(listType)
.command(() => {
const canWrapInList = can().wrapInList(listType)

const filteredMarks = marks.filter(mark => splittableMarks.includes(mark.type.name))
const filteredMarks = marks.filter(mark => splittableMarks.includes(mark.type.name))

tr.ensureMarks(filteredMarks)
tr.ensureMarks(filteredMarks)

if (canWrapInList) {
return true
}
if (canWrapInList) {
return true
}

return commands.clearNodes()
})
.wrapInList(listType)
.command(() => joinListBackwards(tr, listType))
.command(() => joinListForwards(tr, listType))
.run()
return commands.clearNodes()
})
.wrapInList(listType)
.command(() => joinListBackwards(tr, listType))
.command(() => joinListForwards(tr, listType))
.run()
)
}

0 comments on commit f82c85c

Please sign in to comment.