[GH-ISSUE #7214] [FR] Pasting url should paste a link and when there's a highlighted selection it should make it into a link #3191

Closed
opened 2026-03-23 21:28:13 +00:00 by mirror · 10 comments
Owner

Originally created by @chrisirhc on GitHub (Jan 15, 2025).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/7214

Originally assigned to: @asjqkkkk on GitHub.

Description

This is a behaviour documented over at https://github.com/yzhang-gh/vscode-markdown/issues/20 .

Current behaviour on Mobile iOS

Pasting a link results in noop, nothing happens, nothing is pasted. Regardless of whether a selection is highlighted or not.

Expected behaviour

During a past of a URL:

  • If some text is highlighted, that text becomes a link pointing to the URL.
  • Else, paste the URL as text and make it into a link pointing to that URL.

Impact

  • Easier to add links into a document (down from 4 taps on a mobile, to 1 paste action)

Additional Context

No response

Originally created by @chrisirhc on GitHub (Jan 15, 2025). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/7214 Originally assigned to: @asjqkkkk on GitHub. ### Description This is a behaviour documented over at https://github.com/yzhang-gh/vscode-markdown/issues/20 . #### Current behaviour on Mobile iOS Pasting a link results in noop, nothing happens, nothing is pasted. Regardless of whether a selection is highlighted or not. #### Expected behaviour During a past of a URL: * If some text is highlighted, that text becomes a link pointing to the URL. * Else, paste the URL as text and make it into a link pointing to that URL. ### Impact * Easier to add links into a document (down from 4 taps on a mobile, to 1 paste action) ### Additional Context _No response_
mirror 2026-03-23 21:28:13 +00:00
  • closed this issue
  • added the
    editor
    bug
    labels
Author
Owner

@LucasXu0 commented on GitHub (Jan 15, 2025):

Hi @chrisirhc, we support making the selected text into a link format when there is a highlighted selection. If it's not working on your end, there might be an issue. Could you tell me your iOS system version?

https://github.com/user-attachments/assets/7bf985c2-5fa5-490f-8fce-d03fae29f8d6

<!-- gh-comment-id:2591645907 --> @LucasXu0 commented on GitHub (Jan 15, 2025): Hi @chrisirhc, we support making the selected text into a link format when there is a highlighted selection. If it's not working on your end, there might be an issue. Could you tell me your iOS system version? https://github.com/user-attachments/assets/7bf985c2-5fa5-490f-8fce-d03fae29f8d6
Author
Owner

@chrisirhc commented on GitHub (Jan 15, 2025):

Ah, tested it a bit more and found that I saw a few issues I'm facing:

  • Safari's (or GitHub) Share button -> Copy copies a rich text link that results in noop in the Appflowy when pasting. Workaround: tap in the address bar to copy and paste
  • Non-http protocol urls aren't recognized (e.g. bear://x-callback-url/open-note?... ) and so none of the paste functionality works (highlighted selection or not all no-op)
  • When I do copy and paste http url, a system asks whether to "Allow a Paste from Safari". If I click Allow, nothing happens. However, subsequent pastes work.

I'm on iOS 18.2 .

Recording with behavior of GitHub:
https://github.com/user-attachments/assets/f5b05311-d5ad-4b50-9309-df5716cc2079

<!-- gh-comment-id:2591764904 --> @chrisirhc commented on GitHub (Jan 15, 2025): Ah, tested it a bit more and found that I saw a few issues I'm facing: - Safari's (or GitHub) Share button -> Copy copies a rich text link that results in noop in the Appflowy when pasting. Workaround: tap in the address bar to copy and paste - Non-http protocol urls aren't recognized (e.g. bear://x-callback-url/open-note?... ) and so none of the paste functionality works (highlighted selection or not all no-op) - When I do copy and paste http url, a system asks whether to "Allow a Paste from Safari". If I click Allow, nothing happens. However, subsequent pastes work. I'm on iOS 18.2 . Recording with behavior of GitHub: https://github.com/user-attachments/assets/f5b05311-d5ad-4b50-9309-df5716cc2079
Author
Owner

@asjqkkkk commented on GitHub (Jan 18, 2025):

https://github.com/user-attachments/assets/d7a16659-2e28-45f9-9013-71303e646a70

I have found a stable way to reproduce it, it can be reproduced simply by pasting from the clipboard of the input method

<!-- gh-comment-id:2599656625 --> @asjqkkkk commented on GitHub (Jan 18, 2025): https://github.com/user-attachments/assets/d7a16659-2e28-45f9-9013-71303e646a70 I have found a stable way to reproduce it, it can be reproduced simply by pasting from the clipboard of the input method
Author
Owner

@Craigp23 commented on GitHub (Jan 19, 2025):

Is this a related issue...?

Since v0.80 on android, urls are no longer being converted to links. Tried top and tailing the url with markdown ie. [ ]

<!-- gh-comment-id:2600791861 --> @Craigp23 commented on GitHub (Jan 19, 2025): Is this a related issue...? Since v0.80 on android, urls are no longer being converted to links. Tried top and tailing the url with markdown ie. [ ]
Author
Owner

@chrisirhc commented on GitHub (Jan 24, 2025):

Created 2 PRs to demonstrate the issues and potential fixes. The fixes are ugly/hacky because I'm a flutter newbie. They're mainly to illustrate the issue.

  • Safari's (or GitHub) Share button -> Copy copies a rich text link that results in noop in the Appflowy when pasting. Workaround: tap in the address bar to copy and paste

https://github.com/AppFlowy-IO/AppFlowy/pull/7280

  • Non-http protocol urls aren't recognized (e.g. bear://x-callback-url/open-note?... ) and so none of the paste functionality works (highlighted selection or not all no-op)

This is due to the following regex only checking for urls that begin with http:
github.com/AppFlowy-IO/appflowy-editor@d24a7fc2c3/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart (L6)

  • When I do copy and paste http url, a system asks whether to "Allow a Paste from Safari". If I click Allow, nothing happens. However, subsequent pastes work.

https://github.com/AppFlowy-IO/appflowy-editor/pull/1027

Happy to update the fixes based on review suggestions if I receive any review feedback.

<!-- gh-comment-id:2611738556 --> @chrisirhc commented on GitHub (Jan 24, 2025): Created 2 PRs to demonstrate the issues and potential fixes. The fixes are ugly/hacky because I'm a flutter newbie. They're mainly to illustrate the issue. > * Safari's (or GitHub) Share button -> Copy copies a rich text link that results in noop in the Appflowy when pasting. Workaround: tap in the address bar to copy and paste https://github.com/AppFlowy-IO/AppFlowy/pull/7280 > * Non-http protocol urls aren't recognized (e.g. bear://x-callback-url/open-note?... ) and so none of the paste functionality works (highlighted selection or not all no-op) This is due to the following regex only checking for urls that begin with `http`: https://github.com/AppFlowy-IO/appflowy-editor/blob/d24a7fc2c3cbb988b4f8e6a0d972bfb5091e2323/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart#L6 > * When I do copy and paste http url, a system asks whether to "Allow a Paste from Safari". If I click Allow, nothing happens. However, subsequent pastes work. https://github.com/AppFlowy-IO/appflowy-editor/pull/1027 Happy to update the fixes based on review suggestions if I receive any review feedback.
Author
Owner

@asjqkkkk commented on GitHub (Jan 24, 2025):

Hi @chrisirhc , Have you had any issues pasting HTTP links on mobile? Such as https://github.com/, or perhaps only links that don't start with HTTP cause the issue? Such as bear://x-callback-url/open-note

<!-- gh-comment-id:2611937191 --> @asjqkkkk commented on GitHub (Jan 24, 2025): Hi @chrisirhc , Have you had any issues pasting HTTP links on mobile? Such as https://github.com/, or perhaps only links that don't start with HTTP cause the issue? Such as bear://x-callback-url/open-note
Author
Owner

@chrisirhc commented on GitHub (Jan 24, 2025):

Hi @chrisirhc , Have you had any issues pasting HTTP links on mobile? Such as https://github.com/, or perhaps only links that don't start with HTTP cause the issue? Such as bear://x-callback-url/open-note

Yes, I'm seeing issues whenever there's the permission screen to allow paste from the application. See https://github.com/AppFlowy-IO/appflowy-editor/pull/1027 .

I'm also seeing issues whenever pasting what's copied from the Share button. See https://github.com/AppFlowy-IO/AppFlowy/pull/7280 .

<!-- gh-comment-id:2611993436 --> @chrisirhc commented on GitHub (Jan 24, 2025): > Hi @chrisirhc , Have you had any issues pasting HTTP links on mobile? Such as https://github.com/, or perhaps only links that don't start with HTTP cause the issue? Such as bear://x-callback-url/open-note > > Yes, I'm seeing issues whenever there's the permission screen to allow paste from the application. See https://github.com/AppFlowy-IO/appflowy-editor/pull/1027 . I'm also seeing issues whenever pasting what's copied from the Share button. See https://github.com/AppFlowy-IO/AppFlowy/pull/7280 .
Author
Owner

@asjqkkkk commented on GitHub (Jan 24, 2025):

Hi @chrisirhc , Have you had any issues pasting HTTP links on mobile? Such as https://github.com/, or perhaps only links that don't start with HTTP cause the issue? Such as bear://x-callback-url/open-note

Yes, I'm seeing issues whenever there's the permission screen to allow paste from the application. See AppFlowy-IO/appflowy-editor#1027 .

I'm also seeing issues whenever pasting what's copied from the Share button. See #7280 .

Thank you, there might indeed be a permission issue currently. As for whether links that don't start with HTTP can be pasted as links, we may need to double-check the specifications for links

<!-- gh-comment-id:2612006627 --> @asjqkkkk commented on GitHub (Jan 24, 2025): > > Hi [@chrisirhc](https://github.com/chrisirhc) , Have you had any issues pasting HTTP links on mobile? Such as https://github.com/, or perhaps only links that don't start with HTTP cause the issue? Such as bear://x-callback-url/open-note > > Yes, I'm seeing issues whenever there's the permission screen to allow paste from the application. See [AppFlowy-IO/appflowy-editor#1027](https://github.com/AppFlowy-IO/appflowy-editor/pull/1027) . > > I'm also seeing issues whenever pasting what's copied from the Share button. See [#7280](https://github.com/AppFlowy-IO/AppFlowy/pull/7280) . Thank you, there might indeed be a permission issue currently. As for whether links that don't start with HTTP can be pasted as links, we may need to double-check the specifications for links
Author
Owner

@chrisirhc commented on GitHub (Jan 24, 2025):

Thank you, there might indeed be a permission issue currently.

Links that don't start with HTTP can be pasted as links. There's no permission issue for that.
The permission dialog I'm referring to is in https://github.com/AppFlowy-IO/appflowy-editor/pull/1027 .

As for whether links that don't start with HTTP can be pasted as links, we may need to double-check the specifications for links

They can be, you can test this behaviour today by creating a link manually and using a non-http url works fine. I have clicked on it and it navigates to the other app as expected.

Update: I'll split up the bug reports, since they're 3 distinct issues with separate reproduction steps.

<!-- gh-comment-id:2612084179 --> @chrisirhc commented on GitHub (Jan 24, 2025): > Thank you, there might indeed be a permission issue currently. Links that don't start with HTTP can be pasted as links. There's no permission issue for that. The permission dialog I'm referring to is in https://github.com/AppFlowy-IO/appflowy-editor/pull/1027 . > As for whether links that don't start with HTTP can be pasted as links, we may need to double-check the specifications for links They can be, you can test this behaviour today by creating a link manually and using a non-http url works fine. I have clicked on it and it navigates to the other app as expected. Update: I'll split up the bug reports, since they're 3 distinct issues with separate reproduction steps.
Author
Owner

@chrisirhc commented on GitHub (Jan 25, 2025):

I created 2 bug reports:

I didn't create a bug for non-http protocol urls because I can see potential security concerns and also because there is a workaround (via manually pasting into link text field).

<!-- gh-comment-id:2613764414 --> @chrisirhc commented on GitHub (Jan 25, 2025): I created 2 bug reports: * [[Bug] iOS copied links paste into a blank string #7283](https://github.com/AppFlowy-IO/AppFlowy/issues/7283) * [[Bug] When pasting from an app from the first time in a while, first paste fails #7284](https://github.com/AppFlowy-IO/AppFlowy/issues/7284) I didn't create a bug for non-http protocol urls because I can see potential security concerns and also because there is a workaround (via manually pasting into link text field).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#3191
No description provided.