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

Pasting a URL on a text selection no longer hyperlinks the selection #423

Closed
rfgamaral opened this issue Aug 30, 2023 · 0 comments · Fixed by #435
Closed

Pasting a URL on a text selection no longer hyperlinks the selection #423

rfgamaral opened this issue Aug 30, 2023 · 0 comments · Fixed by #435
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@rfgamaral
Copy link
Member

rfgamaral commented Aug 30, 2023

With #411 we fixed Markdown hyperlink pasting which stopped working, however, that introduced this new issue where pasting a URL on a text selection no longer hyperlinks the selection. Instead, the text selection is completely replaced with the URL. This mechanism came from Tiptap, and with the recent updates, the mechanism was moved to the pasteHandler plugin, which got disabled with #411.

The fix for this issue involves reverting #411, and fixing the issue that #411 aimed to fix with a different solution.

One possible solution that I thought of was to implement the validate function from Linkify here, and test for the Markdown hyperlink syntax. If the Markdown hyperlink syntax is found, return false, otherwise return true. This fix will need to be pushed upstream to Tiptap. Also, it may be worth it to introduce a new option to the Link extension to allows users control over this behaviour.

However, the above solution does not work because there's a bug in the Linkify find function, which I reported here. Once that's fixed, and a new Linkify version is released, we can then start working on pushing a fix to Tiptap.

The upstream Tiptap issue is also reported here.

@rfgamaral rfgamaral added bug Something isn't working good first issue Good for newcomers labels Aug 30, 2023
@rfgamaral rfgamaral self-assigned this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant