import { visit } from 'unist-util-visit';

export default function rehypeCustomFootnotes() {
    return (tree: any) => {
        visit(tree, 'element', (node) => {

            if (
                node.tagName === 'h2' &&
                node.properties?.id === 'footnote-label'
            ) {
                node.children[0].value = 'Zdroje'; // Change heading text
            }

            if (
                node.tagName === 'span' &&
                node.properties?.className?.includes('sr-only') &&
                node.children?.[0]?.value?.startsWith('Section titled')
            ) {
                node.children[0].remove;
            }
        });
    };
}


