diff options
author | zotlabs <mike@macgirvin.com> | 2016-12-14 14:27:00 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-12-14 14:28:59 -0800 |
commit | 4094c47e29cc9237d4bad1f984ff8bee02a4dc22 (patch) | |
tree | bcec8c574fc75608d3f2f8782d75c214177ec0af | |
parent | a65ebbb3193b05edcd29c89038e21ba6a856af20 (diff) | |
download | volse-hubzilla-4094c47e29cc9237d4bad1f984ff8bee02a4dc22.tar.gz volse-hubzilla-4094c47e29cc9237d4bad1f984ff8bee02a4dc22.tar.bz2 volse-hubzilla-4094c47e29cc9237d4bad1f984ff8bee02a4dc22.zip |
markdown regex
-rw-r--r-- | include/bb2diaspora.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index e22b6a7dd..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); |