From: x2003bruneau Date: Sat, 8 Jul 2006 21:25:58 +0000 (+0000) Subject: Place formatting before html conversion of the article in order to avoid // matching... X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=1ff637a07c70ca7ef3a013db5957c0fe7fd1c205;p=banana.git Place formatting before html conversion of the article in order to avoid // matching git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@64 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/banana/misc.inc.php b/banana/misc.inc.php index 5161b0d..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,12 +490,6 @@ function formatbody($_text, $format='plain', $flowed=false) .".'
'",
 	            $res);
         }
-		$formatting = Array('\*' => 'strong',
-							'_' => 'u',
-							'/' => 'em');
-		foreach ($formatting as $limit=>$mark) {
-			$res = preg_replace('@' . $limit . '([^\s]+)' . $limit . '@', "<$mark>\\1", $res);
-		}
 		$res = preg_replace("@
-- ?\n@", "
\n-- \n", $res);
         $parts = preg_split("/\n-- ?\n/", $res);
     }