Embedding headings respects hierarchy

Use case or problem

I want to embed multiple blocks / sections based on their hierarchical relationship. But currently embedding a heading means the embed stops at the next heading, even if that is a child.

Proposed solution

I would love for heading embeds to simply respect the heading hierarchy. In other words, given this content:

## Test Heading

Content

Content

### Child heading

More content

## Next Sibling

This embed code: ![[link#Test Heading]] would display all of the above text until the “next sibling” heading. That is, embedding a second level heading would also automatically pull in third, fourth, etc level headings.

Related feature requests (optional)

2 Likes

Yes please! This would be beneficial for policy/legislation notes!

Yes please.
Also, can this be extended to layered bullet points?

Illustration:

  • Main point
    - Sub point 1
    - Sub point 2

With ![[Main point]], ideally I shouldn’t just see “-Main point” but rather the sub points as well. ![[Sub point 1]] should result in just “Sub point 1”

1 Like

you can already grab bullet points by putting the block reference under them (but this may not be exactly what you’re looking for)

e.g.,

- first point
    - second point
    - third point
^blockID

Then just embed that block id

1 Like

Yes, thank you for that, I was not aware of this function. That said, I do think the default should be for embedded headings and bullet points to respect hierarchy - everything until a point/heading of an equal hierarchy level should be considered the same block for the purposes of embedding IMHO.

2 Likes

Tried this, but it doesn’t capture the heading, which (depending on your use) may also be important.

I think this is the crux of it! I’m glad you could write this out using language that is easy to understand. I had this idea in my head, but couldn’t figure out how to write it out!

1 Like