Bases HTML function Links don't open notes they link to

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

Steps to reproduce

  1. Create a note and a base
  2. Add a formula to the base with the following contents:
html("<a href=\"" + file.path + "\">" + file.basename + "</a>")
  1. If not already, make the formula visible in the base
  2. Try and click the links
  3. Observe that the links don’t open their respective notes

Did you follow the troubleshooting guide? [Y/N]

Expected result

The link should open the note it links to.

Actual result

The note doesn’t open and instead nothing happens.

Environment

SYSTEM INFO:
	Obsidian version: v1.10.3
	Installer version: v1.10.3
	Operating system: #1 SMP PREEMPT_DYNAMIC Fri, 14 Nov 2025 06:54:20 +0000 6.17.8-arch1-1
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

I tried the same link element but with an actual website as href, and that actually opened.

2 Likes

Having this problem as well. I noticed that, when rendered, a target="_blank" seems to be forced onto the link, even if you include target="_self" in the code. Maybe that has something to do with it?

1 Like

This is not the right way to link to a note in the vault.

I didn’t find an easy way to restyle a vault link.

I was making a table of contents for my files using bases, but that required some manual html styling, hence why I had to do it this way.

Your formula returns <a href="folder/note">note</a>. Pasting that in a note won’t link to “note.md”. You would need:

<a data-href="folder/note" class="internal-link">note</a>

Pasting that in a note does make a link. A Bases formula for it is:

html("<a data-href='" + file.folder + "/" + file.name + "' class='internal-link'>" + file.name + "</a>")

However, html() internal links like this indeed do not (currently) work in Bases.

That’s where a feature request to apply html() to internal links could come into play.


Workarounds

I assume you know this and had a reason for using HTML, but just in case or for others, either of these formulas create the link from your example:

link(file.path, file.name)
file
3 Likes

I did not know I had to use data-href instead of href, thanks for that.

Unfortunate, I hope this gets fixed in an upcoming update.

I did not know about this when posting the original post, but did come across it recently. I have to use HTML though, since I wanna do indentation etc.