From 2ba3cad8914d016fd42503c4ef99e15f6e307a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Mon, 17 May 2021 21:00:22 +0200 Subject: [PATCH] not sure about this one --- packages/core/src/helpers/findChildrenInRange.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/core/src/helpers/findChildrenInRange.ts b/packages/core/src/helpers/findChildrenInRange.ts index c4f24b13..28dc2260 100644 --- a/packages/core/src/helpers/findChildrenInRange.ts +++ b/packages/core/src/helpers/findChildrenInRange.ts @@ -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({