fn = () => {
  return {
    element: {
      enter: (node, parentNode) => {
        if (
          node.name === 'defs' ||
          (elemsGroups.nonRendering.has(node.name) &&
            node.attributes.id == null)
        ) {
          /** @type {import('../lib/types.js').XastElement[]} */
          const usefulNodes = [];
          collectUsefulNodes(node, usefulNodes);
          if (usefulNodes.length === 0) {
            detachNodeFromParent(node, parentNode);
          }
          node.children = usefulNodes;
        }
      },
    },
  };
}
Removes content of defs and properties that aren't rendered directly without ids.

@author Lev Solntsev

@type {import('../lib/types.js').Plugin}