AppFlowy icon indicating copy to clipboard operation
AppFlowy copied to clipboard

[Bug] Link to a local file does not work correctly

Open He-Zu opened this issue 1 year ago • 4 comments

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

He-Zu avatar Apr 16 '24 09:04 He-Zu

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.

Xazin avatar Apr 16 '24 21:04 Xazin

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

SillyCoon avatar Sep 01 '24 11:09 SillyCoon

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.

Xazin avatar Sep 01 '24 23:09 Xazin

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

SillyCoon avatar Sep 08 '24 08:09 SillyCoon