erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.69k stars 1.12k forks source link

Markdown parser for tel: links too restrictive #729

Open ghost opened 4 years ago

ghost commented 4 years ago

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.

aidantwoods commented 4 years ago

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.

TomWor commented 4 years ago

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