Skip to content

Pasting with a URL on the clipboard #1609

Open
@scripting

Description

Description

This is a question about a feature, not a bug report.

A user has requested the following behavior.

  1. There's a URL on the clipboard.
  2. They select some text.
  3. Paste.

What they want to happen is that the text that was selected is replaced with a link.

If the text was Hollywood.

And https://hollywood.gov/ is on the clipboard.

The selected text would be replaced with:

<a href="https://hollywood.gov/">Hollywood</a>

Why?

Apparently this is standard in software like Slack, and it's a natural feature, and it sounds appealing to me.

GitHub has the feature too. ;-)

I tried to implement

Subscribed to editablePaste event, but never got the call.

Every attempt to implement resulted in the URL on the clipboard replacing the selected text.

Version 5.23 according to MediumEditor.version.

Any help much appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions