Behaviour of Unique Note Creator prefix format containing a /

Steps to reproduce

  • Enable Unique Note Creator under core plugins
  • Go to the plugin’s settings and include a / character in a prefix with other valid characters (eg YYYY/MM)
  • Create a new Unique Note

As a variation on this bug, set the prefix to a single / (I have not tried multiple /s).

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

Y

Expected result

Since / isn’t allowed in ordinary note filenames, the plugin’s settings pane should complain the same way the base Obsidian new note editor does.

At the very least, it should not permit a prefix consisting of a single /.

Actual result

The / was accepted without comment, and the new note automatically creates unexpected folders (as many as there are /s).

Arguably, this could be considered a feature, but it is inconsistent with behaviour elsewhere. If this is desirable behaviour, the settings pane should warn that inclusion of a / will have this effect.

Where the prefix consists only of one or more / characters, nothing seems to happen and subsequent attempts to create notes fail with “Error: filename already exists”.

Environment

SYSTEM INFO:
	Obsidian version: v1.4.16
	Installer version: v1.4.16
	Operating system: Windows 10 Pro 10.0.19045
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

I think, this is a feature, IMHO :thinking: .

I mean, the core plugin Daily Notes works in a similar fashion and you can also use the path to a note (existing or not) in wikilinks …

E.g.: If you add a wikilink such as [[Path/To/My Note]] in a note and the folder Path, the nested folder To and the note My Note don’t exist in your vault, when you click on it, everything in that path will then be created and you’ll end up with something following this structure:

Path
  └─ To
      └─ My Note

You’re not really using slash in the filename when you set something like YYYY/YYYYMMDD/HHmm for the Unique prefix format in the Unique note creator core plugin. You’re telling Obsidian to create a note titled 1027 (as of now) in a folder titled 2023-12-12 (as of today) nested in another folder titled 2023

The format here represent a path to the note, not only its filename :blush: :

2023
  └─ 2023-12-12
         └─ 1027

Being able to set up formatted paths to daily/unique/timestamped notes gives us the possibility to create these types of note where and/or if we want to without having to manually create folders or having to think about changing the settings in the concerned plugins…

I agree though: the Unique core creator core plugin could be a bit clearer when one uses (nested) folders in the format :blush: :

E.g.: the plugins Periodic Notes makes a clear distinction between the filename and where said file will be created

Ok, If there is a leading /, that’s a bug and needs addressing. (related to https://forum.obsidian.md/t/leading-slash-causes-multiple-daily-note-to-be-created/71414)

The rest is okayish. It could use some even more stringent checking but it works in most cases.