linkifyjs icon indicating copy to clipboard operation
linkifyjs copied to clipboard

Add support for file links

Open jjmdg opened this issue 9 years ago • 6 comments

Support for links like \share\directory\file.pdf and file:///\share\directory\file.pdf would be nice (especially for use in a business context).

jjmdg avatar Oct 17 '16 12:10 jjmdg

Not possible: http://stackoverflow.com/questions/5246292/open-local-folder-from-link Producing downloadable links (could be a solution) is probably not in scope for linkify

jjmdg avatar Oct 17 '16 13:10 jjmdg

Could still be implemented so that the user can easily copy the address and paste it to his system. It works like that in Confluence for example.

jjmdg avatar Oct 20 '16 14:10 jjmdg

Problem with not-working file:// links in browsers easily solved via extensions or via pre-configured settings:

  • Firefox settings: https://stackoverflow.com/a/13083926/1395757
  • Firefox extension: https://addons.mozilla.org/en-US/firefox/addon/local-filesystem-links/?src=search
  • Chrome extension: https://chrome.google.com/webstore/detail/local-explorer-file-manag/eokekhgpaakbkfkmjjcbffibkencdfkl

So linkifyjs must only mark file:///home/user/file.txt text as <a href> links, all other work will be done on browser and system side. If we don't want to enable it by default, make this optionally.

MurzNN avatar Jul 11 '17 12:07 MurzNN

At now library already support file:// links with two slashes, but fails with linux-style links contains 3 slashes: file:///home/user/file.txt - here is example:

> const lfy = require('linkifyjs');
undefined
...
> lfy.find('file:///test');
[]
> lfy.find('file://test');
[ { type: 'url', value: 'file://test', href: 'file://test' } ]

So, at first, we must fix the bug with file:///test.

MurzNN avatar Jul 11 '17 13:07 MurzNN

Since RFC8089, both the file:/etc/motd and the file:///etc/motd versions are in use for local URIs.

chrysn avatar Oct 14 '20 14:10 chrysn

I ran into this issue as well. Any idea when V3.0 will be ready?

DSheffield avatar Jun 02 '21 17:06 DSheffield

Links that begin with file: are now supported in the latest Linkify v4.0

nfrasser avatar Sep 19 '22 01:09 nfrasser