feoblog icon indicating copy to clipboard operation
feoblog copied to clipboard

Feature: Paste-to-link

Open NfNitLoop opened this issue 3 years ago • 0 comments

A lot of systems nowadays allow you to "paste over" some text with a link to hyperlink it.

Would be handy if the markdown editor for posts/comments would let you do that.

Ex: given this text:

This is cool!

If the user selects the word This and pastes https://www.google.com/, then the Editor would end up with:

[This] is cool!

[This]: https://www.google.com/

Possible implementation details:

  • If the selection is quite long (say, over 10 characters?) prefer to use a [numbered link like this][1].
  • If there is already a link, re-use that one instead of creating a new one.
  • Need to make sure we don't generate link refs with the same name.

I wrote some code that sort of creates link refs when you add an attachment. Not sure how much of that can be re-used, but should check.

NfNitLoop avatar Apr 26 '22 03:04 NfNitLoop