# editor: Don't treat scheme-prefixed text as a URL when pasting in Markdown \(\#59071\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 053ea47e5ac15c330dd62b669ca41b8a64ff3f02

Requested commit: 053ea47e5ac15c330dd62b669ca41b8a64ff3f02

Commit: 053ea47e5ac15c330dd62b669ca41b8a64ff3f02

Tree: 8d73b5537903d67b41cec6b10a9c0388d355646e

Author: Tom Planche

Committer: GitHub

## Message

```
editor: Don't treat scheme-prefixed text as a URL when pasting in Markdown (#59071)

Pasting text that merely starts with a scheme-like prefix (for example a
commit message like `editor: Fix crash in project panel`) over a
selection in a Markdown buffer would wrap the selection in a Markdown
link, because `url::Url::parse` accepts `editor:` as a valid URL scheme.

Paste now only treats clipboard text as a URL when the whole text is a
single standalone URL, using `linkify` (already a workspace dependency)
instead of `url::Url::parse`. Added a regression test covering the
scheme-like prefix case.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #59070

Release Notes:

- Fixed pasting text starting with a scheme-like prefix (such as
`editor: ...`) over a selection in a Markdown buffer incorrectly
creating a Markdown link.
```

## Parents

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

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