If you are using the new Blocks editor, it saves content as a JSON object. You can write a little recursive function to walk that json and generate a TOC according to your needs
If you are using the new Blocks editor, it saves content as a JSON object. You can write a little recursive function to walk that json and generate a TOC according to your needs