obsidian-stack-overflow
obsidian-stack-overflow copied to clipboard
Feature request - Fetch the url from the clipboard.
This would be so much easier to use if the plugins command read the copied link from the clipboard rather than having to paste it into the document first.
Was able to get this working in main.js by making the following changes in your onload() - this.addCommand...
navigator.clipboard
.readText()
.then((clipText) => (this.convertUrlToTitledLink(editor, clipText)));
// const selectedText = (EditorExtensions.getSelectedText(editor) || "").trim();
// this.convertUrlToTitledLink(editor, selectedText);
Now no longer need to paste the url into the document first, just copy the answer url, set your cursor position where you want the answer pasted and run the command. Works great!
I'll try and add this to the main release, thanks for the catch!