import { findParentNodeClosestToPos } from "https://deno.land/x/netzo@0.5.107/deps/@tiptap/react.ts";
Finds the closest parent node to a resolved position that matches a predicate.
Examples
Example 1
Example 1
findParentNodeClosestToPos($from, node => node.type.name === 'paragraph')
Parameters
$pos: ResolvedPos
The resolved position to search from
predicate: Predicate
The predicate to match
Returns
{ pos: number; start: number; depth: number; node: ProseMirrorNode; } | undefined
The closest parent node to the resolved position that matches the predicate