markdown-it / linkify-it

Links recognition library with full unicode support
http://markdown-it.github.io/linkify-it/
MIT License
655 stars 63 forks source link

Allow urls with ..._ #88

Closed cesarfd closed 4 years ago

cesarfd commented 4 years ago

Mini change that allows underscore characters after .. dots like in the test url.

puzrin commented 4 years ago

https://markdown-it.github.io/#md3=%7B%22source%22%3A%22_Interesting%20text%20http%3A%2F%2Fexample.com%2Flink..._%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Afalse%2C%22_view%22%3A%22html%22%7D%7D

This case may become broken then.

cesarfd commented 4 years ago

Something like http://example.com/foo_bar..._ seems to work fine

puzrin commented 4 years ago

NOW - works. After your change - will not.

cesarfd commented 4 years ago

Ok let me get this straight because maybe I'm missing something. Are you saying that http://example.com/link..._ should become http://example.com/link ? If that's the case, vscode detects both as valid links.

Instead, in this test:

http://example.com/foo_bar...
http://example.com/foo_bar

It's true that the detected url should be the one with no .. at the end but if it has .._ at the end is still a valid url.

puzrin commented 4 years ago

I provided you example, when User has "Text..." with URL in the end, and wrapped into italic. In this case you change will cause false positive for '...', that's not acceptable.