Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions plugin/obsidian.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import json
from pathlib import Path
import urllib.parse
import webbrowser
import logging

Expand Down Expand Up @@ -44,8 +45,9 @@ def get_note(vault_id, note_path):


def open_note(vault_name, note_path):
URI = f'open?vault={vault_name}&file={note_path}'.replace(' ', '%20').replace('/', '%2F').replace('\\', '%2F')
URI = f'obsidian://{URI}'
vault_name = urllib.parse.quote(vault_name)
note_path = urllib.parse.quote(note_path)
URI = f'obsidian://open?vault={vault_name}&file={note_path}'
webbrowser.open(URI)

class Vault(object):
Expand Down Expand Up @@ -134,4 +136,4 @@ def checklists(self):
for note in vault.notes():
print(note.title)
open_note(vault.name, str(note.relative_path))
break
break