not sure about this one

This commit is contained in:
Philipp Kühn
2021-05-17 21:00:22 +02:00
parent 819aa16cfc
commit 2ba3cad891

View File

@@ -7,6 +7,17 @@ import { Predicate, Range, NodeWithPos } from '../types'
export default function findChildrenInRange(node: ProseMirrorNode, range: Range, predicate: Predicate): NodeWithPos[] {
const nodesWithPos: NodeWithPos[] = []
// if (range.from === range.to) {
// const nodeAt = node.nodeAt(range.from)
// if (nodeAt) {
// nodesWithPos.push({
// node: nodeAt,
// pos: range.from,
// })
// }
// }
node.nodesBetween(range.from, range.to, (child, pos) => {
if (predicate(child)) {
nodesWithPos.push({