Support Reference Links in Edit mode/Live Preview (reference-style)

Steps to reproduce

Enter the following Markdown:

Try out [Obsidian][1]!

[1]: https://obsidian.md

Cmd-click (on Mac) to follow the link in Edit mode. You will be brought to an empty note with title [. Note that clicking on the link in the reference still works, just not in the main text body.

Switch to Reading mode. Click on the link. You will be brought to obsidian’s website.

Expected result

Link works in both Edit and Reading modes.

Actual result

Link only works in Reading mode.

Environment

Fresh install on mac OS 12.2.1.

SYSTEM INFO:
	Obsidian version: v0.13.23
	Installer version: v0.13.23
	Operating system: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 21.3.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Safe mode: on

RECOMMENDATIONS:
	none
14 Likes

Moved this to FR.

no prob if this isn’t support yet, but creating the new page with title [ seems like a bug (and keeps generating empty notes around my vault that I need to delete)

6 Likes

Two brackets like [aaa][aaa]now are render as a link, and click it will create new file named [ accidently.

Steps to reproduce

As described above. This is the reproduce in sandbox vault.

Expected result

No new file created because it is not a link syntax.

Actual result

See above.

Environment

  • Operating system: Win 11
  • Debug info:
SYSTEM INFO:
	Obsidian version: v0.14.5
	Installer version: v0.13.31
	Operating system: Windows 10 Education 10.0.22581
	Login status: logged in
	Catalyst license: supporter
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Safe mode: on

RECOMMENDATIONS:
	none

3 Likes

I opened a new bug report for this problem, which is clearly a bug and not a missing feature.

3 Likes

I moved this to bug reports since this specific issue generates a lot of confusion. Bear in mind that nothing changes, there are no ETAs on this.

2 Likes

Steps to reproduce

Test in Linux desktop and iOS app, same result. Only first party plugins are installed or enabled.

  • Create a new note.
  • Create a new reference link [0]: https://example.com
  • Create a link using the reference link [my link][0]
  • While still in edit mode click on the new link
  • a new note is created named [

Expected result

Clicking the link should open the reference link

Actual result

Clicking the link in editor mode creates a new note named [

Environment

  • Operating system: Linux and iOS
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.0.0
    Installer version: v1.0.0
    Operating system: #1 SMP PREEMPT_DYNAMIC Thu, 13 Oct 2022 18:58:49 +0000 6.0.1-arch2-1
    Login status: logged in
    Catalyst license: insider
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: Obsidian Nord
    Snippets enabled: 0
    Restricted mode: on
3 Likes

Platform

[x] iOS
[ ] Android

Obsidian Mobile version: v1.4.1


Given a note with eg the content below

my little note

with a [ref style link][1]

doesn't work at all on iOS...

[1]: https://obsidian.md/

All that happens when clicking on the link above is, a new note is created, with a filename of [

see screenshot

2 Likes

Also was going to file a bug on the fact that Reference Style Links [foo][1] are not rendered correctly inside of callouts on iOS mobile app even as of v1.4.3

They just appear “as is” without the clickable link

Is this part of the same bug?

here’s a screenshot

1 Like

I encountered the same problem:

When you copy-paste from Wikipedia, for example, they have various references as [1][2][3].

In Reading Mode it looks as you would expect, but in Live Preview, that would look like 1[3], and the 1 behaves like a link. When you click on it, it creates a note with [ as a title.

Example in the sandbox:

ezgif.com-video-to-gif

Note: I had already done the test, so the [ titled page was already there, but it creates it when first clicked.

SYSTEM INFO:
Obsidian version: v1.1.15
Installer version: v1.1.9
Operating system: Windows 10 Pro 10.0.22621
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0

1 Like

I think that the current behavior is at the very least counterintuitive, for the simple reason that ![text][markdownfile] ![text][markdownfile.md] and ![alternate][pdffilename.pdf] all work in reading mode. (If this is intentional, then I suppose it is not a bug, but it sure does feel like one, which I think should be a hint…)

2 Likes

Also, reference style link to internal pages will be considered as external links by obsidian

[text][a]

[a]: folder/file.md

In the above markdown, a is an internal link, but Obsidian will consider it as an external link.

2 Likes

Is there any solution to this? It is still not working correctly years after.

1 Like

I just started using Obsidian and this is annoying… is there any solution on how to fix this?

1 Like

I addressed this issue by opening a split and having the editor on the left and the “reading view” on the right. However, it is frustrating to have a note with a random title [ hanging around. If this cannot be easily fixed, it would be helpful if Obsidian could at least prevent clicks on [text][ref] links in live preview mode.

This bug where clicking a reference style link on iOS still persists as of app ver 1.4.6

Clicking a reference link does not open the link, instead it causes a new note to be created, with a title of [

This is troublesome - is there a fix in the works?

4 Likes

Link labels aren’t properly rendered / handled. A link label is a link of the form [display text][label], where [label] is given a destination later on in the document.

In the following markdown:

My link: [foo][bar]

[bar]: https://example.com

Should be rendered as

<p>My link: <a href="https://example.com">foo</a></p>

Steps to reproduce

Enter the following markdown into an obsidian document.

Link to report: [Jepsen Report][jepsen-report]. This [report][jepsen-report] contains detailed and useful information regarding redpanda.

[jepsen-report]: https://go.redpanda.com/hubfs/PDFs/Jepsen-Report-Redpanda-2022.pdf

Did you follow the troubleshooting guide? Yes

This issue is reproducible in a sandbox vault.

Expected result

This creates two links, “Jepsen Report”, and “report”, with the link destination set to https://go.redpanda.com/hubfs/PDFs/Jepsen-Report-Redpanda-2022.pdf. In other words, the effect should be the same as the following:

Link to report: [Jepsen Report](https://go.redpanda.com/hubfs/PDFs/Jepsen-Report-Redpanda-2022.pdf). This [report](https://go.redpanda.com/hubfs/PDFs/Jepsen-Report-Redpanda-2022.pdf) contains detailed and useful information regarding redpanda.

The documentation for this feature in Github Flavored Markdown is given here: https://github.github.com/gfm/#link-label

Actual result

“Jepsen Report” is rendered like a link, but clicking on it opens a new document containing only a [

This behavior is unexpected and unusual.

Environment

SYSTEM INFO:
	Obsidian version: v1.4.16
	Installer version: v1.4.16
	Operating system: Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:45 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6020 23.1.0
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

This is a common way I use of defining links, especially in documents I’ve imported into Obsidian, because it makes the markdown a lot more readable to use link labels.

The full reference spec for this feature in Github Markdown can be found here: https://github.github.com/gfm/#link-label

2 Likes

It’d be really nice to see a fix when possible! I submitted an issue for it before realizing it’d been covered before.

Github has a nice specification for the way their markdown handles this (is there a rule against linking to github?)

1 Like

I’ll often quote from a single source several times, and I would really like to be able to link them all from the same place.

It helps a lot when I need to update them to a Wayback Machine archive or locally cached version for example.

But generally it just reduces clutter in the documents.

Footnotes don’t support spaces in their reference names and of course show the superscript instead of a link. Plus they don’t work in live preview anyway. So it’s not really a solution.

I’ve just been dumping links in a bottom section and hoping I’ll be able to figure out which is which in the future.

The [ bug is still present. Even if reference links aren’t supported, creating a weird filename is still a nonsensical bug. :person_shrugging:

5 Likes