Legible block refs via automatic alias, like page refs do

Use case or problem

I like using block refs a lot. I mostly use them inline instead of embedded. If you just make a block ref it’s hard to know what you’re talking about though, because it’s just a garble of numbers and letters unlike page refs.

It’s a bit of a chore to get a legible inline block reference though. These are the steps I take to make a legible block ref to the same page via aliasing:

  1. start typing [[^ to search
  2. search for the block by typing a couple of works
  3. use up/down to select the right block
  4. tab to reference and move the cursor to the end of the id
  5. type | followed by by the start of the block text

I’d like the block ref to be legible by default.

Proposed solution

Obsidian already does something very similar for page links to make them legible.

If you have a unique page name, refs to it don’t include its path so they are very legible in text.

If you have a non-unique page name, you will get an alias automatically on the ref. For example, if you have pages one/two/three and one/three, and link to one of them, you will get an alias added automatically. E.g. for the first page you get [[one/two/three|three]], and it just shows up as three.

I’d like Obsidian to automatically do this for block refs too.

Blocks usually have a lot more text than page names, and can have newlines and other things, so I imagine a little bit of massaging would be necessary. Probably a character limit followed by ... ellipsis, plus whitespace trimming, maybe trimming non-alphanumeric characters.

For instance, making a block ref to the block above would insert the reference [[^cc6c3b|Block usually have a lot...]] and show up as Block usually have a lot... when not editing the ref.

I’d like this to work for same page block refs and block refs to other pages too.

Current workaround (optional)

I currently do it manually, following the steps above.

Related feature requests (optional)

A proposal for rendering block embeds inline is similar but asks for embedding. I’m asking for inline aliasing instead, like how page refs work today.