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

If magnet scheme is not added destroys the visual result #410

Open
gethminar opened this issue Nov 3, 2022 · 2 comments
Open

If magnet scheme is not added destroys the visual result #410

gethminar opened this issue Nov 3, 2022 · 2 comments
Assignees
Labels

Comments

@gethminar
Copy link

gethminar commented Nov 3, 2022

Hi. I love so much your JS plugin Linkify.

It recognizes http, https, ftp and ftps (where's the complete list?!)

Anyway, this post it's about magnet.

If there's not magnet recognition a string like

text text text

magnet:?xt=urn:btih:5a7f5e0f3ce439e2f1a83e718a8405ec8809110b&dn=ernfkjenrkfk%5FSQ80%5FV%5Fv1.0.0%5Ferfnkerkf%5Ferfnkerkfefrfvegrteggt.net.rar&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=udp%3A%2F%2Ftracker.zer0day.to%3A1337&tr=udp%3A%2F%2Ftracker.pirateparty.gr%3A6969&tr=udp%3A%2F%2Fp4p.arenabg.ch%3A1337&tr=udp%3A%2F%2Feddie4.nl%3A6969&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337&tr=http%3A%2F%2F109.235.50.166%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Feddie4.nl%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2F9.rarbg.com%3A2710%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.ilibr.org%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.ilibr.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.zer0day.to%3A1337%2Fannouncement

by using linkifyStr(str) gives the result

text text text

magnet:?xt=urn:btih:5a7f5e0f3ce439e2f1a83e718a8405ec8809110b&amp;dn=ernfkjenrkfk%5FSQ80%5FV%5Fv1.0.0%5Ferfnkerkf%<a href="http://5Ferfnkerkfefrfvegrteggt.net">5Ferfnkerkfefrfvegrteggt.net</a>.rar&amp;tr=udp%3A%2F%<a href="http://2Ftracker.leechers-paradise.org">2Ftracker.leechers-paradise.org</a>%3A6969&amp;tr=udp%3A%2F%<a href="http://2Ftracker.coppersurfer.tk">2Ftracker.coppersurfer.tk</a>%3A6969&amp;tr=udp%3A%2F%<a href="http://2Ftracker.opentrackr.org">2Ftracker.opentrackr.org</a>%3A1337&amp;tr=udp%3A%2F%<a href="http://2Ftracker.zer0day.to">2Ftracker.zer0day.to</a>%3A1337&amp;tr=udp%3A%2F%<a href="http://2Ftracker.pirateparty.gr">2Ftracker.pirateparty.gr</a>%3A6969&amp;tr=udp%3A%2F%<a href="http://2Fp4p.arenabg.ch">2Fp4p.arenabg.ch</a>%3A1337&amp;tr=udp%3A%2F%<a href="http://2Feddie4.nl">2Feddie4.nl</a>%3A6969&amp;tr=udp%3A%2F%<a href="http://2Ftracker.internetwarriors.net">2Ftracker.internetwarriors.net</a>%3A1337&amp;tr=http%3A%2F%2F109.235.50.166%3A2710%2Fannounce&amp;tr=udp%3A%2F%<a href="http://2Ftracker.opentrackr.org">2Ftracker.opentrackr.org</a>%3A1337%2Fannounce&amp;tr=udp%3A%2F%<a href="http://2Feddie4.nl">2Feddie4.nl</a>%3A6969%2Fannounce&amp;tr=udp%3A%2F%<a href="http://2Ftracker.leechers-paradise.org">2Ftracker.leechers-paradise.org</a>%3A6969&amp;tr=udp%3A%2F%<a href="http://2F9.rarbg.com">2F9.rarbg.com</a>%3A2710%2Fannounce&amp;tr=udp%3A%2F%<a href="http://2F9.rarbg.me">2F9.rarbg.me</a>%3A2710%2Fannounce&amp;tr=udp%3A%2F%<a href="http://2Ftracker.coppersurfer.tk">2Ftracker.coppersurfer.tk</a>%3A6969%2Fannounce&amp;tr=udp%3A%2F%<a href="http://2Ftracker.ilibr.org">2Ftracker.ilibr.org</a>%3A80%2Fannounce&amp;tr=udp%3A%2F%<a href="http://2Ftracker.ilibr.org">2Ftracker.ilibr.org</a>%3A6969%2Fannounce&amp;tr=udp%3A%2F%<a href="http://2Ftracker.zer0day.to">2Ftracker.zer0day.to</a>%3A1337%2Fannouncement

that there's not text and not link. It's a mix of both.

A fiddle to understand the result: fiddle


So. There's a way to disable the plugin for date pattern?

Or there's a way to enable others file's URI recognition like magnet, but also telnet, bitcoin, dns, facetime, finger, git, go, gopher, gtalk, irc, spotify, market, nfs, muble, ssh, tftp, vnc, network files and others of this uri schemes?

P.S. Could you better explain what's the difference between plugin *.js,*.cjs.js, *.es.js?

Edit
Opening the main file I understood that network file scheme it's recognized.

	  fastts(Start, 'file', SCHEME, WORD, wordjr); // <<<<<<< HERE
	  fastts(Start, 'mailto', SCHEME, WORD, wordjr);
	  fastts(Start, 'http', SLASH_SCHEME, WORD, wordjr);
	  fastts(Start, 'https', SLASH_SCHEME, WORD, wordjr);
	  fastts(Start, 'ftp', SLASH_SCHEME, WORD, wordjr);
	  fastts(Start, 'ftps', SLASH_SCHEME, WORD, wordjr);

but what for the network file scheme that starts with //?

And reading better the documentation there's also the registerPlugin option, but the link See example plugin function implementations it's broken 😭 and the option registerCustomProtocol (that does not work with magnet😭😭).

Pls, could you give an example for magnet?

Tnx in advance

@nfrasser
Copy link
Owner

@gethminar thanks for reporting, the magnet link not working once registerCustomProtocol is called is definitely a bug, I'll fix this in an upcoming release.

So. There's a way to disable the plugin for date pattern?

Can you elaborate on this? I'm not sure what you mean.

but what for the network file scheme that starts with //?

This used to work but was removed following #206 because it's generally not expected. Can likely be added as a plugin using the Mention plugin as a reference

And reading better the documentation there's also the registerPlugin option, but the link See example plugin function implementations it's broken 😭 and the option registerCustomProtocol (that does not work with magnet😭😭).

Links have been fixed! Sorry about that 😅

@nfrasser nfrasser added the bug label Nov 10, 2022
@nfrasser nfrasser self-assigned this Nov 10, 2022
@gethminar
Copy link
Author

gethminar commented Nov 11, 2022

@nfrasser (Nick Frasser top of the world)

And reading better the documentation there's also the registerPlugin option, but the link See example plugin function implementations it's broken 😭 and the option registerCustomProtocol (that does not work with magnet😭😭).

Links have been fixed! Sorry about that 😅

It is like it was before 😅😅

So. There's a way to disable the plugin for date pattern?

Re-elaboration: Put the condition that there's not a magnet link discovery implementation.

The answer it's about the possibility of disabling the link adding for a date regex like this, so the link it's not added to this regex.

but what for the network file scheme that starts with //?

This used to work but was removed following #206 because it's generally not expected. Can likely be added as a plugin using the Mention plugin as a reference

Bad news. It would have been very useful. Please give some example, I'm not so able to do this. If there's something pre-made it's better (something like a file to add)

P.S. Waiting hardly for your next release. Should be beautiful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants