Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add URL paste handler #2768

Merged
merged 2 commits into from
Jan 16, 2024
Merged

feat: Add URL paste handler #2768

merged 2 commits into from
Jan 16, 2024

Conversation

nalderto
Copy link
Contributor

I added this with this PR, but it was removed with this commit.

This PR hooks onto the paste event, if text is highlighted, and there is a valid URL in the clipboard, then the editor will use markdown syntax to turn the highlighted text into a hyperlink with the URL in the clipboard. This matches the behavior of GitHub. This especially makes it easier to paste URLs on mobile.

@nalderto nalderto requested a review from boojack as a code owner January 16, 2024 01:15
@boojack
Copy link
Collaborator

boojack commented Jan 16, 2024

we supported automatically turn URLs into links. That means if you type https://www.usememos.com, it will automatically be turned into a link even though you haven’t used brackets.

FYI, so the Markdown standard link syntax is optional.

https://www.usememos.com/docs/getting-started/content-syntax#links

@nalderto
Copy link
Contributor Author

Screencast.from.2024-01-15.17-33-07.webm

This addresses a different issue I show in the screencast. This is where you want to paste a URL, but want it to be a hyperlink to an existing typed string

Copy link
Collaborator

@boojack boojack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boojack boojack merged commit ff13d97 into usememos:main Jan 16, 2024
5 checks passed
@nalderto nalderto deleted the fix-url-paste branch January 16, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants