Giter Site home page Giter Site logo

Comments (7)

HelloZeroNet avatar HelloZeroNet commented on June 10, 2024 1

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>"

from zerome.

HelloZeroNet avatar HelloZeroNet commented on June 10, 2024 1

Opened an issue for it: markedjs/marked#1763

from zerome.

HelloZeroNet avatar HelloZeroNet commented on June 10, 2024 1

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.

from zerome.

styromaniac avatar styromaniac commented on June 10, 2024

Why ZeroTalk has no problem is my question.

from zerome.

styromaniac avatar styromaniac commented on June 10, 2024

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

from zerome.

styromaniac avatar styromaniac commented on June 10, 2024

I say we should go with the Marked 2014 version.

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

from zerome.

HelloZeroNet avatar HelloZeroNet commented on June 10, 2024

It should be fixed by dd2719c

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 >)

from zerome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.