Hiding the specified header of an embed


I have a couple working strings gathered from the discord and a couple posts here but I cannot get all the parts working properly.

This snippet will hide a specific header (H1 and H2 in this case), in all embed, in LP and in an exported doc

/* remove H1 and H2 from embed no matter what*/
.cm-s-obsidian .markdown-embed h1, h2,
.markdown-preview-view .markdown-embed h1, h2 {
  display: none;

The issue with the above is I don’t always want to hide H2 but if I embed a note at H3 then I want that hidden. This is not flexible at all.

The following will hide your specified header when you embed as such ![[thing#header]]. BUT it won’t hide it when exported.

/* remove the specified header when embedding via header */
/* eg: ![[thing#header]]  this works in preview only atm */
:is(span, div)[alt].internal-embed .markdown-preview-section > .markdown-review-pusher + div > :is(h1,h2,h3,h4,h5,h6) {
    display: none;

What I am really looking for is the second snippet to work in an export, but it is way too complex for me to figure out. I can monkey click things to find out selectors but I have no clue what selector an export would follow in the case of this span