Vinzent03/obsidian-advanced-uri

[Bug?] Using prepend in note with frontmatter causes an error, so it does nothing except focus Obsidian

Closed this issue · 0 comments

I am wanting to create a global hotkey that opens Obsidian and places me into a specific note, wherein it inserts a datestamp and I can begin typing.

Since I want the newest entries to be at the top, I am using prepend.

Unfortunately, when I fire this URI URL (obsidian://advanced-uri?vault=obsidian&filepath=_Meta-Utils%2FScratch&data=test&mode=prepend) off, it opens Obsidian, but then does nothing else. I looked in the console to see that it's choking on the frontmatter (I made a sample file with minimalized frontmatter, after it didn't work with more complex frontmatter)-- it does work if the file has no frontmatter.

Received URL action {vault: 'obsidian', filepath: '_Meta-Utils/Scratch', data: 'shit', mode: 'prepend', action: 'advanced-uri'} plugin:obsidian-advanced-uri:4707 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'end') at AdvancedURI.prepend (plugin:obsidian-advanced-uri:4707:51) at async Handlers.handleWrite (plugin:obsidian-advanced-uri:3833:21)