In .base files, local URIs in formulas do not open

Steps to reproduce

In the sandbox

  • Create a new note, and add a property whose value is a local URI, such as:
---
myLink: file:///C:%5CUsers
---
  • Create a new base file, click Properties > AddFormula, and enter the formula myLink (or even link(myLink)).
  • In the base column, click that link.

Did you follow the troubleshooting guide?

Y

Expected result

The link opens.

Actual result

The link does not open.

Environment

SYSTEM INFO:
Obsidian version: v1.10.0
Installer version: v1.9.14
Operating system: Windows 11 Pro for Workstations 10.0.26100
Login status: logged in
Language: en
Catalyst license: insider
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0

RECOMMENDATIONS:
none


Additional information

Console error:

index.html:1
Not allowed to load local resource: file:///C:/%5CUsers

Works as expected in:

  • embedded bases
  • directly displayed properties (i.e., not in a formula) even in the .base file
3 Likes

Hi.

Know this doesn‘t help you, but both of your ideas work on macOS: the Users folder opens from either base below.

The C:%5C part is needed on Windows?

Do you know why the console shows an extra forward slash after C:?

file:///C:%5CUsers

file:///C:/%5CUsers

---
myLink: file:///Users
---

```base
formulas:
  myLink: myLink
views:
  - type: table
    name: Table
    order:
      - file.name
      - formula.myLink

```


```base
formulas:
  myLink: link(myLink)
views:
  - type: table
    name: Table
    order:
      - file.name
      - formula.myLink

```

:red_question_mark: Stupid additional question, but does file:///C:%5CUsers work when in the body of a note?

No, it’s a good question:

:check_mark: It works in the body.

:check_mark: It works in the note’s Properties.

:check_mark: It works when displaying the property as a column in a base.

:cross_mark: It doesn’t work from formulas in the .base file.

:check_mark: It works from formulas in embedded contexts: both base code blocks and ! base embeds.

The the bug report is about the inconsistency is in those last two.


(edits to simplify my list and because I misunderstood this part:)

Nope, don’t know why there’s another slash.

1 Like

thanks. I can confirm this corner case is not working.

1 Like

I have noticed the following behaviour when using “Cards” view.

  • Clicking on the raw file:/// link doesn’t work.
  • Clicking on a formula with a link("file:///") does not work either.
  • Right clicking on either of those and clicking “open link in default browser” does work.

Update

In original report, formula versions of links worked in embedded contexts but not directly in the .base file. Now it seems the formula versions do not work from embeds either.

Obsidian version: 1.10.6
Installer version: 1.10.6

A full note for reproduction:

---
myLink: file:///C:%5CUsers
---

```base
formulas:
  formulaLink: myLink
  this formula link does not work: myLink
views:
  - type: table
    name: Table
    filters:
      and:
        - file == this.file
    order:
      - file.name
      - myLink
      - formula.this formula link does not work

```

  • :white_check_mark: The link in the first column works (displayed property).
  • :cross_mark: The link in the second column does not work (property formula).

Workaround:

Right-click the link and select Open link in default browser.

That opens the link as expected.

will be fixed 1.11.x. No ETAs.

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.