linkify-it icon indicating copy to clipboard operation
linkify-it copied to clipboard

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

Open andrey-skl opened this issue 3 years ago • 1 comments

  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

andrey-skl avatar Sep 26 '22 08:09 andrey-skl

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

puzrin avatar Oct 21 '22 13:10 puzrin