From: Tobias Diekershoff Date: Sat, 20 Jun 2015 12:27:42 +0000 (+0200) Subject: hide some HTML coded chars from markdownification X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7c48ed60eb6bab2bf4a820bfcdf209a4736a364c;p=friendica.git hide some HTML coded chars from markdownification --- 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.