Command clicking an empty link results in a new empty file named ().md being created

Platform

  • Obsidian 0.14.6 (installer 0.14.6)
  • macOS 12.3.1

Bug Description

When in edit mode (new editor, not legacy) and you command-click on an empty link like the one below:

This is a test [something]()
                    ^--command click anywhere here

…Obsidian will create and switch to an entirely new, empty file, named ().md in your vault. e.g.
image

After this happens, when I open the JS console to see if any warnings or errors were displayed, I find none. In my opinion, command-clicking an empty link should not create a file named () — it should just be a no-op.

1 Like

First, your example is not a wikilink, but a markdown link… :wink:

Second, maybe I don’t completely understand your problem - but of course, if you change the link’s target (which, in markdown links, is the part between “()”, whereas the first part between “[]” is the link’s alias), obsidian will create a new file in case it doesn’t exist yet.

Ah, thanks, that’s true. I updated the OP. Actually your reply led me to the repro steps, so I updated the post to include that too. I still think it’s a bug, command-clicking an empty link should not create a file named () — it should just be a no-op.

But still, that’s expected behaviour. When you click a non-existing link, the link (means: the file) will be created - that’s what obsidian does (see here)

Update: Just tried myself - though in general the creation of a new file is expected behaviour, some different things happen depending on which editor you are using:

  • With the old legacy editor, a new empty file is created in edit mode, when you ctrl + click in between the parentheses; in reading mode, though, a popup appears which is asking you if you really want obsidian to open an external link.
  • If, however, you click on the link’s alias, nothing happens at all;
  • With the new live preview mode, clicking the alias will create a new empty file as you described in your example.

At least, obsidian’s behaviour should be consistent, regardless of editor and mode; ideally,

  • nothing happens when you click an empty link
  • file will be created if you click a non-empty, non-existing link.

I can’t think of a single case where creating an empty file named () would be the desired behavior. The parentheses are never supposed to be part of the filename.

I have not yet found a consistent way to make this happen. Happened twice this week. One time I managed to get the note named with parentheses to be created, probably by additional keyboard input after that popup happened:

image

Given I do not know yet what causes it to happen, it also makes retrying in safe mode a bit of a hassle at the moment.

I searched the reports and got no hits on this, but I can also understand that parentheses are a special case for searches.

Steps to reproduce

  1. Used Ctrl+K to wrap existing text to become a link.

Expected result

Editor creating the link markup around the wrapped text and waiting for a URI to be provided within the parentheses, no popup to create a page named after parentheses.

Actual result

Got this pop up once the cursor positioned itself in the parentheses.
image

Environment

  • Operating system:
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v0.14.6
    Installer version: v0.14.2
    Operating system: Windows 10 Home 10.0.19043
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: Obsidian gruvbox
    Snippets enabled: 0
    Safe mode: off
    Plugins installed: 2
    Plugins enabled: 2
    1: Advanced Tables
    2: Sort & Permute lines

Steps to reproduce

Create a new document.

Put [foo://bar]() in the document.

Click the link.

Expected result

Obsidian should show some kind of indicator that there is no link at all.

The link should not navigate anywhere.

Actual result

Obsidian opens a page called ()

Environment

  • Operating system: macOS
  • Debug info:

SYSTEM INFO:
Obsidian version: v1.1.15
Installer version: v1.1.9
Operating system: Darwin Kernel Version 22.4.0: Fri Feb 10 08:10:52 PST 2023; root:xnu-8796.100.721.505.3~4/DEVELOPMENT_ARM64_T6000 22.4.0
Login status: logged in
Catalyst license: none
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: light
Community theme: Typora-Vue v1.0.1
Snippets enabled: 0
Restricted mode: off
Plugins installed: 43
Plugins enabled: 20
1: Advanced Tables v0.18.1
2: Folder Note v0.7.3
3: Breadcrumbs v3.6.4
4: Auto Link Title v1.4.1
5: Auto Hide v0.4.4
6: Checklist v2.2.12
7: Templater v1.16.0
8: Recent Files v1.3.5
9: Zoom v1.1.1
10: Dataview v0.5.55
11: Obsidian Git v2.16.0
12: Execute Code v1.6.2
13: Copy button for code blocks v0.1.0
14: Highlightr v1.2.2
15: MAKE.md v0.6.12
16: Copy Block Link v1.0.4
17: Omnisearch v1.11.1
18: Dynamic Table of Contents v0.0.27
19: Quick Switcher++ v2.3.7
20: Admonition v9.2.1

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.