Drag and drop link from browser to create full-fledged Markdown link

Use case or problem

I want to simplyfiy creating links to the Internet in Markdown with Obsidian.

Current workaround

Currently, you can already drag and drop a URL into Obsidian, but Obsidian will then only insert the URL, not create a full inline Markdown link with link text in the [link text](url) syntax.

The “Paste URL into Selection” helps a little bit. But it’s still cumbersome: I have to write or paste the link text, select it and then copy and paste the URL into that selection. These are still too many steps. A simple drag and drop operation could replace all ot these.

Proposed solution

Obsidian should allow dragging a URL from the address bar or any link from a page in the web browser to the Obsidian Mardown editor to create a fully-fledged Markdown link including link text.

Evernote is able to do this, for example. You can simply drag a link on a page in the browser or the addres bar to the Evernote client. Evernote will then generate a fully functional link with the link text being either the tile of the page if you drag fom the adrress bar or the text of the link if you drag a link from the page. (Of course, Evernote does not create Markdown but rich text, but the principle is the same.)

This shows that the information passed in the drop event contains both the URL and the link text. Obsidian should make use of the full information passed in the drop event, i.e. not only the URL, but also the link text, in order to create the full Markdown link.

Update

In recent versions of Obsidian, a part of the proposed solution has already been implemented, namely dragging links to the Obsidian editor. In fact the implemented solution for copying links is even more general, since it not only converts links, but also other HTML formatting to Markdown.

However, dragging a URL from the address bar still does not work as nicely as it could, since it only copies the URL, and does not create a full-fledged Markdown link including the title of the page. I think this should be possible since the title is transmitted as part of the drag-and-drop protocol in most browsers/platforms, similar to how it works with HTML formatting.

5 Likes

I was just going to file the same thing.

will be implemented in 0.10.1

3 Likes

Just tried it out in 0.10.1. Dragging links from the browser now works as in the proposed solution, and the implementation in 0.10.1 is even more general: You can now drag any selection on the page, not only a link, and it will be converted to Markdown. That’s really cool.

Dragging the URL from the address bar (using the :lock: symbol as handle) also works in principle. However, currently the created Markdown uses the URL as link text. It would be so much better if it would use the title of the page instead.

Update: Just noticed that this was already discussed on Discord and @Licat wants to fix it. We should leave this feature request open until then as a reminder.

Update: In 0.10.2, dragging links from the address bar still doesn’t paste a link with the title of the URL, it just pastes the URL (Chrome) or a link with the URL as title (Firefox).

In v0.12.4 and dragging links from the Chrome browser I do not get a Markdown link with the [link text](url) syntax. Just the URL as a link. What am I doing wrong?

1 Like

Same for me here: Wikilink not markdown link in drag & drop

v0.12.15, I’m able to drag & drop from HTML in Chrome & it retains links & images. I have the ‘Auto convert HTML’ setting enabled.

Dragging links from address bar just paste the URL.

@nnhoang. That’s the current state, exactly. I have updated my original posting above.