From 63efbdffe6ef653e1556a7b34ea59b75b234e759 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 14 Dec 2016 14:27:00 -0800 Subject: markdown regex --- include/bb2diaspora.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/bb2diaspora.php') diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index ffb157b2f..87a8551ae 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -130,6 +130,9 @@ function markdown_to_bb($s, $use_zrl = false) { $s = html_entity_decode($s,ENT_COMPAT,'UTF-8'); + // if empty link text replace with the url + $s = preg_replace("/\[\]\((.*?)\)/ism",'[$1]($1)',$s); + // first try plustags $s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}\+/','diaspora_mention_callback',$s); @@ -149,8 +152,6 @@ function markdown_to_bb($s, $use_zrl = false) { $s = html2bbcode($s); - $s = preg_replace("/\[([uz])rl=(.*?)\]\[\[uz]rl\]/ism",'[$1rl=$2]$2[/$1rl]',$s); - // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands $s = str_replace('♲',html_entity_decode('♲',ENT_QUOTES,'UTF-8'),$s); -- cgit v1.2.3