Git Product home page Git Product logo

Comments (10)

puzrin avatar puzrin commented on July 23, 2024

Thanks for report and clear sample.

See

linkify-it/lib/re.js

Lines 104 to 106 in cbc0833

// don't allow `--` in domain names, because:
// - that can conflict with markdown — / –
// - nobody use those anyway
. I think this can be added via options (disabled by default). Is this really necessary (need your opinion)?

from linkify-it.

xPaw avatar xPaw commented on July 23, 2024

Looks like there are a couple of places where there's URL restrictions due to markdown. Sounds like a good idea to be able to disable all these markdown restrictions.

from linkify-it.

puzrin avatar puzrin commented on July 23, 2024

After thinking a bit... no options needed. Two dashes should just work, according to RFC.

I can't promiss to make this soon, but PR will be accepted without delay.

from linkify-it.

xPaw avatar xPaw commented on July 23, 2024

Would it be just removing these lines? Which it seems to become same regex as src_domain_root

linkify-it/lib/re.js

Lines 103 to 107 in cbc0833

'|' +
// don't allow `--` in domain names, because:
// - that can conflict with markdown — / –
// - nobody use those anyway
'(?:' + re.src_pseudo_letter + '(?:-(?!-)|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +

It's a bit hard to tell from just looking at the code.

from linkify-it.

puzrin avatar puzrin commented on July 23, 2024

No, src_domain_root (top level domain) does not allow dashes at all. This line should exist, but be more clever. I can't say more immediately. Those regexes are mad even with comments :)

from linkify-it.

xPaw avatar xPaw commented on July 23, 2024

For info: There are domains with two dashes too: www.a--b.com www.c--u.com

Or even three dashes: http://a---b.com/

from linkify-it.

puzrin avatar puzrin commented on July 23, 2024

That's not TLD-s. TLD-s are .com, .eu etc.

from linkify-it.

xPaw avatar xPaw commented on July 23, 2024

Yeah my bad.

from linkify-it.

puzrin avatar puzrin commented on July 23, 2024

Nevermind, i think we understand each other. Fixed rule should be "allow dashes according to RFC in all domain parts except TLD".

from linkify-it.

astorije avatar astorije commented on July 23, 2024

@puzrin, is there any chance you could take a look at this?
We switched to linkify-it (in thelounge/thelounge#2397) a few months back, and about to release a new major version of our project, it would be so nice if this was fixed :)

from linkify-it.

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.