handle multiple underscores in D* links
This commit is contained in:
parent
5a7363b248
commit
08941d4285
2 changed files with 8 additions and 1 deletions
|
|
@ -221,13 +221,18 @@ function bb2diaspora($Text,$preserve_nl = false) {
|
|||
|
||||
$Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
|
||||
|
||||
$Text = preg_replace('/\[(.*?)\]\((.*?)\\\\_(.*?)\)/ism','[$1]($2_$3)',$Text);
|
||||
$Text = preg_replace_callback('/\[(.*?)\]\((.*?)\)/ism','unescape_underscores_in_links',$Text);
|
||||
|
||||
call_hooks('bb2diaspora',$Text);
|
||||
|
||||
return $Text;
|
||||
}
|
||||
|
||||
function unescape_underscores_in_links($m) {
|
||||
$y = str_replace('\\_','_', $m[2]);
|
||||
return('[' . $m[1] . '](' . $y . ')');
|
||||
}
|
||||
|
||||
function format_event_diaspora($ev) {
|
||||
|
||||
$a = get_app();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue