Bases: Validate against forbidden characters in views

Steps to reproduce

  1. Create a new base.
  2. Add a new view to the base with a name that includes a colon, such as “Foo: Bar”.
  3. Go to another note and attempt to set “Foo: Bar” as your default view, such as “![[Something.base#Foo: Bar]]”.
  4. Press Enter to “Accept” the “Foo: Bar” view in the selection list.
  5. The embed will be updated to “![[Something.base#Foo Bar]]” and will not be found due to the missing colon.

I’m using the Vim plugin, and if I hit Escape to exit insert mode without accepting the drop-down, the default view will correctly show “Foo: Bar”.

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

I tried this in the sandbox by creating Untitled.base and a “Foo: Bar” view, then embedding it in another note, and I still ran into the problem.

Expected result

I’d expect the embed to be ![[Untitled.base#Foo: Bar]]

Actual result

The embed ends up as ![[Untitled.base#Foo Bar]]

Environment

SYSTEM INFO:
Obsidian version: v1.9.2
Installer version: v1.7.7
Operating system: Windows 11 Pro 10.0.26100
Login status: logged in
Language: en
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

3 Likes

It happens for any characters that are forbidden or used in Obsidian links:

![[Untitled.base#View 1]]
![[Untitled.base#View [fix]]]
![[Untitled.base#View 2]]
![[Untitled.base#¯ _(ツ)_/¯]]

I guess either restrict those characters in view names with a warning, or show a warning that certain characters won’t work for embedded bases (but let you use them anyway).

1 Like

will be implemented 1.9.5

1 Like

Heads up this bug still is happening as of 1.9.6

Where?

When there is a special character like a colon in the view name it shows up in the preview list.


But as soon as you hit enter on a suggested view it will replace the “:” with a space. Then the view can’t be found.

It works totally fine if you manually go back and replace the space with the colon though.
image

You should get an error when you try to create a view with unsupported characters.

1 Like

Oh I see that now. So the error does show up but if you hit enter it still lets you create it. Not sure if that is intended or not.

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