import { findParentNode } from "https://deno.land/x/netzo@0.5.107/deps/@tiptap/react.ts";
Finds the closest parent node to the current selection that matches a predicate.
Examples
Example 1
Example 1
findParentNode(node => node.type.name === 'paragraph')
Parameters
predicate: Predicate
The predicate to match
Returns
(selection: Selection) => { pos: number; start: number; depth: number; node: import("https://esm.sh/v135/prosemirror-model@1.21.1/X-ZS9yZWFjdCxyZWFjdC1kb20scmVhY3QvanN4LXJ1bnRpbWU/dist/index.d.ts").Node; } | undefined
A command that finds the closest parent node to the current selection that matches the predicate