I have a simple terms page made up of heading and paragraph blocks. I'd like to filter the_content before output in order to get the content of any heading blocks and create a menu with links to named anchors at the top. Of course, by the time I filter
$content it's already just a string of HTML, no block info.
How might I fetch an array of all the 'blocked' content in my the_content filter? Or is there a better way to achieve this that I'm missing?
Or perhaps I should be running a filter on save rather than at output..?