# Idea: Paste links in the editor

**URL:** https://meta.discourse.org/t/idea-paste-links-in-the-editor/47125
**Category:** UX
**Tags:** pr-welcome
**Created:** [July 11, 2016, 8:57pm UTC](https://meta.discourse.org/t/idea-paste-links-in-the-editor/47125 "2016-07-11T20:57:37Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [January 21, 2021, 8:48am UTC](https://meta.discourse.org/t/idea-paste-links-in-the-editor/47125/8 "2021-01-21T08:48:26Z")

</div>

> [@JimPas](#):
>
> In Wordpress, what determines whether the text is `replaced` with what’s in the clipboard or `inserts a hyperlink` without overwriting the existing text using a simple select & paste as you suggest?

A combination of clipboard content and editor state:

- If cliboard content is _not_ a valid URL: the paste will act just as you said (replace any selected text or append it at the cursor otherwise)
- If the clipboard _is_ an URL and:
  - no text selected: the URL will be inserted at the cursor position
  - text selected: use that text as an anchor text.

* * *

Considering that there are a few other things that doesn’t quite work as other editors ([cough](https://meta.discourse.org/t/undo-ctrl-cmd-z-doesnt-work-for-markdown/51026), [cough](https://meta.discourse.org/t/editor-markup-issues-when-toggling-text-attributes/49957)), I’m pretty sure it wouldn’t be such a big problem for users 🙂

---

_[View the full topic](https://meta.discourse.org/t/idea-paste-links-in-the-editor/47125)._
