scambier / obsidian-omnisearch

A search engine that "just works" for Obsidian. Supports OCR and PDF indexing.
GNU General Public License v3.0
1.19k stars 60 forks source link

[BUG] Unable to open note when filename contains # character #49

Closed quinncomendant closed 2 years ago

quinncomendant commented 2 years ago

Problem description:

Omnisearch is unable to open notes which contain a # character in the filename. Instead, a new note is created. Obsidian's built-in Quick switcher is able to open files with # in filename successfully.

I can recreate the problem like this:

  1. Create a note named, e.g., Crazy #hashtag time!
  2. Invoke Omnisearch: Vault search
  3. Type Crazy and this note is the first match
  4. Hit return to open this note
  5. A new note is created named Crazy

Here's a screencast showing 1) Omnisearch creating a new note instead of opening the note Crazy #hashtag time!, and 2) Quick switcher opening this note successfully.

Screen Recording 2022-05-14 at 10 44 52

I expect Omnisearch to open the note Crazy #hashtag time!, not to create a new note named Crazy. A new note should only be created when typing Shift-return.

I know Obisidian recommends not using # character inside note titles, but I have imported many notes from other sources and some contains #. Although it's a rare edge case, it's probably easy to fix?

Your environment:

scambier commented 2 years ago

Are there other community plugins that manage to do this? Because what's happening is that Omnisearch calls the openLinkText() function, but Obsidian somehow fails to open the note thus creates a new one.

quinncomendant commented 2 years ago

Are there other community plugins that manage to do this?

I'm not aware of any. Obsidian's built-in Quick switcher works fine, but as a core plugin it might use private APIs to open the note.

scambier commented 2 years ago

Obsidian bug:

Unlikely to be fixed in the short term. It looks like Obsidian handles these files with minimal issues, but the same can't be said for the public API.