markdown regex

This commit is contained in:
zotlabs 2016-12-14 14:27:00 -08:00
parent a7af6d8a3c
commit 63efbdffe6

View File

@ -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);