X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=banana%2Fmisc.inc.php;h=ece2883ef69d085785304492376162a94741b2e5;hb=03851c088a828bbf9387367fe6f6dcf465089624;hp=8d905e386fe6b15fe0ed24c57a6a4d3ed282279f;hpb=0eb1e7efe03b1b18b95d846ee103d1dbed416c4e;p=banana.git diff --git a/banana/misc.inc.php b/banana/misc.inc.php index 8d905e3..ece2883 100644 --- a/banana/misc.inc.php +++ b/banana/misc.inc.php @@ -456,7 +456,13 @@ function formatbody($_text, $format='plain', $flowed=false) $res = '
'.html_entity_decode(to_entities(richtextToHtml($_text))).'
'; } else { $res = "\n\n" . to_entities(wrap($_text, "", $flowed))."\n\n"; - } + $formatting = Array('\*' => 'strong', + '_' => 'u', + '/' => 'em'); + foreach ($formatting as $limit=>$mark) { + $res = preg_replace('@' . $limit . '([^\s]+)' . $limit . '@', "<$mark>\\1", $res); + } + } if ($format != 'html') { global $banana; @@ -484,7 +490,7 @@ function formatbody($_text, $format='plain', $flowed=false) .".'
'",
 	            $res);
         }
-	$res = preg_replace("@
-- ?\n@", "
\n-- \n", $res);
+		$res = preg_replace("@
-- ?\n@", "
\n-- \n", $res);
         $parts = preg_split("/\n-- ?\n/", $res);
     }