parsedown icon indicating copy to clipboard operation
parsedown copied to clipboard

Markdown parser for tel: links too restrictive

Open ghost opened this issue 6 years ago • 2 comments

Im my country, phone numbers look like this: +41 79 123 45 67.

This works fine in mobile browsers, but [phonelink](tel:+41 79 123 45 67) gets ignored by parsedown, which leads me to believe it is too restrictive in this case. Should be an easy fix, might attempt later.

ghost avatar Oct 21 '19 14:10 ghost

In CommonMark, links with spaces are supported by either writing the URL encoded characters (i.e. %20), or by enclosing the link in angle brackets (e.g. [phonelink](<tel:+41 79 123 45 67>)).

Parsedown doesn't currently support the latter method properly, so we should fix that :)

The reason for not allowing raw spaces when the link is not enclosed in angle brackets, is that a space after the URL is used to denote the link title.

aidantwoods avatar Oct 21 '19 15:10 aidantwoods

The "tel:" link type is not recognized by ParseDown as it's not in the whitelist. Easily fixed, I made a pull request. https://github.com/erusev/parsedown/pull/771

TomWor avatar Jun 26 '20 14:06 TomWor