Block reference without space changing reference on link autocomplete

Once you’ve done the above, delete everything above this line.

Steps to reproduce

In note ‘Definition’ create a block with a reference, e.g.

- (Acronym: Definition)^def-acronym

In another note, reference the block with

![[Definitions#^def-acronym]]

When present with link autocomplete, select def-acronym from the Definitions page

Did you follow the troubleshooting guide? [N]

Please, follow the Troubleshooting Guide before answering Yes.

Expected result

The block should be referenced, with the reference unchanged and display

  • (Acronym: Definition)

Actual result

On selecting autocomplete, if there is no space between the block and the ^, a new unique id is created for the block and the original one is ignored and changed so that it is no longer a referenceable code.

I.e. selecting def-acronym from the auto complete menu resolves as

![[Definitions#^3a7566]]

Going to the Definitions page, this line has now become

  • (Acronym: Definition)^def-acronym ^3a7566

The ^def-acronym is no longer formatted as a reference but ^3a7566 is

If you include a space before the block reference then the id is not modified on selection and ^def-acronym is maintained correctly

Environment


SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.11.7
Operating system: Windows 11 Enterprise 10.0.26200
Login status: not logged in
Language: en-GB
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: Minimal 8.1.5
Snippets enabled: 0
Restricted mode: off
Plugins installed: 8
Plugins enabled: 8
1: Dataview v0.5.68
2: Homepage v4.3.1
3: QuickAdd v2.12.0
4: Templater v2.18.1
5: Tasks v7.23.1
6: Paste image rename v1.6.1
7: Minimal Theme Settings v8.2.1
8: Style Settings v1.0.9

Additional information

Either the reference should not appear valid in the link auto complete or should not be modified if selected in the autocomplete

Including a space is the way to name a block in Obsidian. From the documentation:

You can also create human-readable block identifiers by adding a blank space followed by a caret (^) and the identifier.

source: Internal Links - Obsidian Help

That your example looks like a block ID in Live Preview is a quirk. When you switch to Reading, you should see that the syntax without a space renders as regular text and not a block ID, in accordance with the docs.

The feature itself isn’t part of markdown, so there are no external specs for it, just the Obsidian flavor.

The suggester can bring up all blocks, even unnamed ones. Comparing, the version without a space doesn’t actually show up as a pre-named block ID in the suggester.

The one with the correct syntax (a space):

The one with incorrect syntax (no space):

For clarity, are you saying the behaviour is not a bug but a “quirk”? The app acts in an unexpected way, hence raising it

Without a space, it’s not a block ID.

Live Preview makes it look as if it were a block ID, but it is not. That false appearance is what I referred to as a “quirk” of Live Preview.

If Live Preview and Reading were to be made exactly equal, then per the docs, the false appearance in Live Preview is what ought to be fixed (making it clear that it’s not a block ID when there’s no space). Reading view has the correct rendering.

Either way, the functionality is correct as is. A space is required to make a block ID.