Skip to content

Conversation

@Jikstra
Copy link
Contributor

@Jikstra Jikstra commented Nov 22, 2018

Fixes #63

@puzrin
Copy link
Member

puzrin commented Nov 23, 2018

@Jikstra
Copy link
Contributor Author

Jikstra commented Nov 25, 2018

#63 (comment) according to discussion, no options needed for correct implementation.

So you want this to be the default behaviour? I'm not too familiar with markdown and it's limitiations, so i don't know when a url with multiple dashes would cause trouble.

Test patterns should be placed in https://github.com/markdown-it/linkify-it/masterf/test/fixtures/links.txt when possible. Also, the real domain names required, not artificial ones.

Thanks, will try to update the code accordingly.

@Jikstra
Copy link
Contributor Author

Jikstra commented Nov 25, 2018

@puzrin on more question, is http://a.b--c.de/ % -- disabled, because collision possible still a url which shouldn't be allowed? Because writing a regex which checks that the dashes are only in the subdomain part is maybe a lot harder than just removing the small regex part which i made optional with the opts flag.

@puzrin
Copy link
Member

puzrin commented Nov 25, 2018

So you want this to be the default behaviour?

Yes.

I'm not too familiar with markdown and it's limitiations, so i don't know when a url with multiple dashes would cause trouble.

If you do exactly as discussed in #63, that will be ok. We already discussed the best possible behaviour. Any deviation will require to do all checks again.

@puzrin
Copy link
Member

puzrin commented Nov 25, 2018

New relaxed rule should touch only domain names (except TLD), and should not touch path.

@Jikstra
Copy link
Contributor Author

Jikstra commented Nov 25, 2018

My fix also allows urls like https://net--lify.com which you can't register (so i guess they are invalid). There was the one not-link test which i removed, i don't think this is a problem (and if so only a collission with markdown). If this is really a problem, i'm going to try to implement a regex which only allows multiple dashes in the second or lower levels.

Copy link
Member

@puzrin puzrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please squash everything into single commit.

lib/re.js Outdated
// - nobody use those anyway
'(?:' + re.src_pseudo_letter + '(?:-(?!-)|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
'(?:' + re.src_pseudo_letter + '(?:-' +
'|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
Copy link
Member

@puzrin puzrin Nov 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 2 lines have broken formatting/indent - not like other code. Please, follow conding style for other parts of file. All you had to do - just remove (?!-) and don't touch anything else.

% Domains with multiple dashes
%

https://5b0ee223b312746c1659db3f--thelounge-chat.netlify.com/docs/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed other samples, discussed in #63.

@Jikstra Jikstra force-pushed the feature_add_option_to_allow_double_dash_domains branch from 5b14f2f to f713fb0 Compare November 25, 2018 19:20
@Jikstra
Copy link
Contributor Author

Jikstra commented Nov 27, 2018

hey @puzrin is anything still blocking you from merging this?

@puzrin puzrin changed the title Add option to allow domains containing more than two dashes Allow dashes according to RFC in all domain parts except TLD Nov 27, 2018
@puzrin puzrin merged commit bb7b5ce into markdown-it:master Nov 27, 2018
@xPaw
Copy link

xPaw commented Nov 27, 2018

Thanks @Jikstra!

Hopefully a package update can be pushed to npm too.

@Jikstra
Copy link
Contributor Author

Jikstra commented Nov 28, 2018

@xPaw no problem, the-lounge seems nice, know some people who are using it. I'm glad i could helped you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants