diff options
author | friendica <info@friendica.com> | 2012-05-26 23:46:42 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-05-26 23:46:42 -0700 |
commit | 08941d42856984a3076e972804ac016400341f91 (patch) | |
tree | 16d410c7c39d3ea2e7716b25bcf7e1cda944c79d /include/bb2diaspora.php | |
parent | 5a7363b248e51b93c401a84d1b99f33632c44711 (diff) | |
download | volse-hubzilla-08941d42856984a3076e972804ac016400341f91.tar.gz volse-hubzilla-08941d42856984a3076e972804ac016400341f91.tar.bz2 volse-hubzilla-08941d42856984a3076e972804ac016400341f91.zip |
handle multiple underscores in D* links
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r-- | include/bb2diaspora.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 8487f845a..d86ba4543 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -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(); |