Removing Empty Sections Programatically

Wanted to see if there are any thoughts on how to programmatically delete empty sections in a note?

I use a template for meeting notes. To keep them less cluttered and full of empty content, I like to clean them up and remove sections I didn’t use. Think maybe 10 different headings (of the same type H2) that just have nothing beneath them to the next H2 heading. At times I can have 3-4 of those sections, just not used.

Any tips/tricks on how to reduce the workload of manually removing those after each meeting? Rather than select this small section, delete, next, delete, next delete. Curious if using some type of macro extensions (QuickAdd?) I can create something to delete any empty sections in the notes at once vs the manual process.

The Apply Patterns plugin ought to be able to do this. But I’m not the person to be able to teach you the regex needed to do what you want with it :slight_smile: