HelloZeroNet / ZeroMe

Social network for ZeroNet
GNU General Public License v3.0
166 stars 76 forks source link

IPv6 address links don't work. #147

Closed styromaniac closed 4 years ago

styromaniac commented 4 years ago

On ZeroTalk, they do, but on ZeroMe, I get in the address bar:

about:blank#blocked

Screenshot_20200923-192926

It doesn't even become clickable until I use square brackets and parenthesis to title the link.

It doesn't matter if App 0 is in use. It's the same in plain Chrome. Firefox doesn't do anything when clicking the blue link.

Arching Kaos Radio (example IPv6 address link) https://[205:2c4b:693e:44fb:635f:9dae:510:aa1f]/

HelloZeroNet commented 4 years ago

Looks like markedjs does not recognize ipv6 addresses:

> marked("http://any.txt https://[205:2c4b:693e:44fb:635f:9dae:510:aa1f] sasdw wewe")
"<p><a href="http://any.txt">http://any.txt</a> https://[205:2c4b:693e:44fb:635f:9dae:510:aa1f] sasdw wewe</p>"
HelloZeroNet commented 4 years ago

Opened an issue for it: https://github.com/markedjs/marked/issues/1763

styromaniac commented 4 years ago

Why ZeroTalk has no problem is my question.

HelloZeroNet commented 4 years ago

Looks like an earlier version of marked does turn ipv6 urls to links:

ZeroTalk (Marked 2014 version):

> marked("IPv4 url: http://127.0.0.1/index.html\n IPv6 url: https://[205:2c4b:693e:44fb:635f:9dae:510:aa1f]/\n")
< "<p>IPv4 url: <a href="http://127.0.0.1/index.html">http://127.0.0.1/index.html</a>
 IPv6 url: <a href="https://[205:2c4b:693e:44fb:635f:9dae:510:aa1f]/">https://[205:2c4b:693e:44fb:635f:9dae:510:aa1f]/</a></p>
"

ZeroMe (Marked 2018 version):

> marked("IPv4 url: http://127.0.0.1/index.html\n IPv6 url: https://[205:2c4b:693e:44fb:635f:9dae:510:aa1f]/\n")
< "<p>IPv4 url: <a href="http://127.0.0.1/index.html">http://127.0.0.1/index.html</a>
 IPv6 url: https://[205:2c4b:693e:44fb:635f:9dae:510:aa1f]/</p>
"

So we can try to revert to previous version, or replace these links with a regexp.

styromaniac commented 4 years ago

I've switched to ZeroTalk's version for ZeroMe Luna.

styromaniac commented 4 years ago

I say we should go with the Marked 2014 version.

But I must ask: What are the pros and cons of a regexp?

HelloZeroNet commented 4 years ago

It should be fixed by https://github.com/HelloZeroNet/ZeroMe/commit/dd2719c63731a0c1e648bcc2d9a9d81e7326baaa

But I must ask: What are the pros and cons of a regexp?

Later version of the marked.js lib could have bug fixes/new features (like links between < and >)