UnistのvisitParentsを使ったデモ https://github.com/syntax-tree/unist-util-visit-parents demo code. https://codesandbox.io/p/sandbox/great-robinson-5h7h3t?file=%2Fsrc%2Ffeatures%2Funistscript%2Fcomponents%2FDemo%2FDemo.tsx closestと使い勝手が同じになるのでハンデ