refactoring

This commit is contained in:
Philipp Kühn 2021-06-04 15:17:52 +02:00
parent be776e09f9
commit e680544b7d

View File

@ -147,6 +147,10 @@ export const Figure = Node.create<FigureOptions>({
nodes.push(...findChildrenInRange(doc, range, predicate)) nodes.push(...findChildrenInRange(doc, range, predicate))
} }
if (!nodes.length) {
return false
}
nodes.forEach(({ node, pos }, index) => { nodes.forEach(({ node, pos }, index) => {
const mappedPos = tr.steps const mappedPos = tr.steps
.slice(tr.steps.length - index) .slice(tr.steps.length - index)