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

Colon after URL is included into URL, when using markdown-it with `linkify: true` #106

Open andrey-skl opened 1 year ago

andrey-skl commented 1 year ago
  1. Have the markdown: test https://example.org/abc: test
  2. Parse it with markdown-it, where linkify option is enabled. See sandbox: https://markdown-it.github.io/#md3=%7B%22source%22%3A%22test%20https%3A%2F%2Fexample.org%2Fabc%3A%20test%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

Expected result: Colon is not included into parsed URL, as github markdown parser does Example from github parser:

github

Actual result: colon is included into URL

Screenshot 2022-09-26 at 10 20 06
puzrin commented 1 year ago

This is not related to markdown, see linkify-it standalone demo.

AFAIK, : is valid URL char. Restricting : at the end can break links like this: http://markdown-it.github.io/linkify-it/#t1=test%20https%3A%2F%2Fexample.org%2F%3F%3Afoo%3A%26%3Abar%3A%20test