[GH-ISSUE #5146] [Bug] Link to a local file does not work correctly #2278

Closed
opened 2026-03-23 21:21:08 +00:00 by mirror · 5 comments
Owner

Originally created by @He-Zu on GitHub (Apr 16, 2024).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/5146

Bug Description

entering a link to a file by hand works e.g.
4

I can open the file with the link

1

but if I only enter text and then create a link via the menu and enter the path to the file, an error "broken link" appears

2

it works with a weblink
5

How to Reproduce

see pictures

Expected Behavior

i think that both ways of creating a link should work

Operating System

linux

AppFlowy Version(s)

0.5.4

Screenshots

No response

Additional Context

No response

Originally created by @He-Zu on GitHub (Apr 16, 2024). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/5146 ### Bug Description entering a link to a file by hand works e.g. ![4](https://github.com/AppFlowy-IO/AppFlowy/assets/116963345/f738d8d2-f8ac-49c3-8901-8117ae87be44) I can open the file with the link ![1](https://github.com/AppFlowy-IO/AppFlowy/assets/116963345/4d8101e5-090c-431a-95cb-ef10ebbe93e9) but if I only enter text and then create a link via the menu and enter the path to the file, an error "broken link" appears ![2](https://github.com/AppFlowy-IO/AppFlowy/assets/116963345/4e3f7b48-c07e-4b39-81b8-a9f64cf01408) it works with a weblink ![5](https://github.com/AppFlowy-IO/AppFlowy/assets/116963345/754ce47d-f006-4441-8b8d-1dd4e2728ac1) ### How to Reproduce see pictures ### Expected Behavior i think that both ways of creating a link should work ### Operating System linux ### AppFlowy Version(s) 0.5.4 ### Screenshots _No response_ ### Additional Context _No response_
Author
Owner

@Xazin commented on GitHub (Apr 16, 2024):

I believe the scheme of http | https is currently hardcoded.

We should be able to allow IPv4/6, SSH, (S)FTTP, SMTP, and other protocols such as the File protocol that is mentioned in this issue.

Some other protocols that could be taken on as well: mailto, vnc, and imap.

<!-- gh-comment-id:2059970403 --> @Xazin commented on GitHub (Apr 16, 2024): I believe the scheme of `http | https` is currently hardcoded. We should be able to allow IPv4/6, SSH, (S)FTTP, SMTP, and other protocols such as the File protocol that is mentioned in this issue. Some other protocols that could be taken on as well: `mailto`, `vnc`, and `imap`.
Author
Owner

@SillyCoon commented on GitHub (Sep 1, 2024):

Hi! Can I work on this issue?
I found the relevant place in appflowy-editor, seems like current isUrl validator understands only http, https and ftp
github.com/AppFlowy-IO/appflowy-editor@a64a5165e7/lib/src/editor/toolbar/desktop/items/link/link_menu.dart (L119)

<!-- gh-comment-id:2323303741 --> @SillyCoon commented on GitHub (Sep 1, 2024): Hi! Can I work on this issue? I found the relevant place in `appflowy-editor`, seems like current `isUrl` validator understands only `http`, `https` and `ftp` https://github.com/AppFlowy-IO/appflowy-editor/blob/a64a5165e79bd2424e594b793843a7158e7d4fb4/lib/src/editor/toolbar/desktop/items/link/link_menu.dart#L119
Author
Owner

@Xazin commented on GitHub (Sep 1, 2024):

Hi! Can I work on this issue? I found the relevant place in appflowy-editor, seems like current isUrl validator understands only http, https and ftp github.com/AppFlowy-IO/appflowy-editor@a64a5165e7/lib/src/editor/toolbar/desktop/items/link/link_menu.dart (L119)

I'm not too sure what the desired behavior is, if we should allow eg. file protocol for collaborative workspaces.

It could lead to misleading information where one user believe they have access to a file but in reality, it exists on the local of someone elses device, meaning if they follow the link they won't be able to find what they're looking for.

Anyhow, feel free to open a PR, and we can take a look.

<!-- gh-comment-id:2323549482 --> @Xazin commented on GitHub (Sep 1, 2024): > Hi! Can I work on this issue? I found the relevant place in `appflowy-editor`, seems like current `isUrl` validator understands only `http`, `https` and `ftp` https://github.com/AppFlowy-IO/appflowy-editor/blob/a64a5165e79bd2424e594b793843a7158e7d4fb4/lib/src/editor/toolbar/desktop/items/link/link_menu.dart#L119 I'm not too sure what the desired behavior is, if we should allow eg. `file` protocol for collaborative workspaces. It could lead to misleading information where one user believe they have access to a file but in reality, it exists on the local of someone elses device, meaning if they follow the link they won't be able to find what they're looking for. Anyhow, feel free to open a PR, and we can take a look.
Author
Owner

@SillyCoon commented on GitHub (Sep 8, 2024):

@Xazin hi! Could you please take a look at PR or point out some direction I could work on? Thank you!

<!-- gh-comment-id:2336598058 --> @SillyCoon commented on GitHub (Sep 8, 2024): @Xazin hi! Could you please take a look at PR or point out some direction I could work on? Thank you!
Author
Owner

@Xazin commented on GitHub (Oct 8, 2024):

Closing as completed 👍

<!-- gh-comment-id:2400873909 --> @Xazin commented on GitHub (Oct 8, 2024): Closing as completed 👍
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#2278
No description provided.