When I use the "Accordion" formatting option with the Block editor, the links in the automatically generated TOC don't work, even when the sections are expanded.