diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 919bfc331d..34c932f745 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -95,6 +95,9 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { } else $Text = bbcode($Text, $preserve_nl, false, 4); + // mask some special HTML chars from conversation to markdown + $Text = str_replace(array('<','>','&'),array('&_lt_;','&_gt_;','&_amp_;'),$Text); + // If a link is followed by a quote then there should be a newline before it // Maybe we should make this newline at every time before a quote. $Text = str_replace(array("
"), array(""), $Text); @@ -104,6 +107,9 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { // Now convert HTML to Markdown $Text = new HTML_To_Markdown($Text); + // unmask the special chars back to HTML + $Text = str_replace(array('&_lt_;','&_gt_;','&_amp_;'),array('<','>','&'),$Text); + $a->save_timestamp($stamp1, "parser"); // Libertree has a problem with escaped hashtags. diff --git a/include/text.php b/include/text.php index f8bbfcee24..2d265e6eee 100644 --- a/include/text.php +++ b/include/text.php @@ -1138,9 +1138,9 @@ function smilies($s, $sample = false) { ); $icons = array( - '', - '
', - '
', + '
', + '
', + '
', '
', '
', '
', @@ -1217,7 +1217,7 @@ function preg_heart($x) { return $x[0]; $t = ''; for($cnt = 0; $cnt < strlen($x[1]); $cnt ++) - $t .= '
'; + $t .= '
'; $r = str_replace($x[0],$t,$x[0]); return $r; }