not sure about this one
This commit is contained in:
@@ -7,6 +7,17 @@ import { Predicate, Range, NodeWithPos } from '../types'
|
|||||||
export default function findChildrenInRange(node: ProseMirrorNode, range: Range, predicate: Predicate): NodeWithPos[] {
|
export default function findChildrenInRange(node: ProseMirrorNode, range: Range, predicate: Predicate): NodeWithPos[] {
|
||||||
const nodesWithPos: 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) => {
|
node.nodesBetween(range.from, range.to, (child, pos) => {
|
||||||
if (predicate(child)) {
|
if (predicate(child)) {
|
||||||
nodesWithPos.push({
|
nodesWithPos.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user