# Implement Markdown link embedding on paste \(\#38639\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/c88fdaf02d82160a5d321c28f238320c08e965e5)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: c88fdaf02d82160a5d321c28f238320c08e965e5

Requested commit: c88fdaf02d82160a5d321c28f238320c08e965e5

Commit: c88fdaf02d82160a5d321c28f238320c08e965e5

Tree: 052f8421c03b3814f73c7e0272ecc14f747ae454

Author: Joseph T\. Lyons

Committer: GitHub

## Message

```
Implement Markdown link embedding on paste (#38639)

This PR adds automatic markdown URL embedding on paste when you are in
text associated with the Markdown language and you have a valid URL in
your clipboard. This the default behavior in VS Code and GitHub, when
pasting a URL in Markdown. It works in both singleton buffers and multi
buffers.

One thing that is a bit unfortunate is that, previously, `do_paste` use
to simply call `Editor::insert()`, in the case of pasting content that
was copied from an external application, and now, we are duplicating
some of `insert()`'s logic in place, in order to have control over
transforming the edits before they are inserted.

Release Notes:

- Added automatic Markdown URL embedding on paste.

---------

Co-authored-by: Cole Miller <53574922+cole-miller@users.noreply.github.com>
```

## Parents

- [003163eb4f08e87eace4aaa40f41bdfb5a7c1f19](https://git.cafe/gitcafe/zed/commit/003163eb4f08e87eace4aaa40f41bdfb5a7c1f19?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/c88fdaf02d82160a5d321c28f238320c08e965e5?format=markdown)
