Closed styromaniac closed 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>"
Opened an issue for it: https://github.com/markedjs/marked/issues/1763
Why ZeroTalk has no problem is my question.
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.
I've switched to ZeroTalk's version for ZeroMe Luna.
I say we should go with the Marked 2014 version.
But I must ask: What are the pros and cons of a regexp?
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 >)
On ZeroTalk, they do, but on ZeroMe, I get in the address bar:
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]/