From b16addc663d7ec76c85eb3097c65b933b221fa49 Mon Sep 17 00:00:00 2001 From: Florian Dorn Date: Thu, 12 Sep 2013 17:16:10 +0200 Subject: [PATCH] added support for the tel: url-scheme --- markdown.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/markdown.php b/markdown.php index 17e5152..e387b1e 100644 --- a/markdown.php +++ b/markdown.php @@ -1447,9 +1447,16 @@ class Markdown_Parser { > }xi', array(&$this, '_doAutoLinks_email_callback'), $text); + $text = preg_replace_callback('{<(tel:([^\'">\s]+))>}i',array(&$this, '_doAutoLinks_tel_callback'), $text); return $text; } + function _doAutoLinks_tel_callback($matches) { + $url = $this->encodeAttribute($matches[1]); + $tel = $this->encodeAttribute($matches[2]); + $link = "$tel"; + return $this->hashPart($link); + } function _doAutoLinks_url_callback($matches) { $url = $this->encodeAttribute($matches[1]); $link = "$url"; @@ -1740,4 +1747,4 @@ negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. */ -?> \ No newline at end of file +?>