Place formatting before html conversion of the article in order to avoid // matching...
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sat, 8 Jul 2006 21:25:58 +0000 (21:25 +0000)
committerx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sat, 8 Jul 2006 21:25:58 +0000 (21:25 +0000)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@64 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/misc.inc.php

index 5161b0d..ece2883 100644 (file)
@@ -456,7 +456,13 @@ function formatbody($_text, $format='plain', $flowed=false)
         $res = '<br/>'.html_entity_decode(to_entities(richtextToHtml($_text))).'<br/>';
     } 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</$mark>", $res);
+        }
+       }
 
     if ($format != 'html') {
         global $banana;
@@ -484,12 +490,6 @@ function formatbody($_text, $format='plain', $flowed=false)
                    .".'</pre></blockquote><pre>'",
                    $res);
         }
-               $formatting = Array('\*' => 'strong',
-                                                       '_' => 'u',
-                                                       '/' => 'em');
-               foreach ($formatting as $limit=>$mark) {
-                       $res = preg_replace('@' . $limit . '([^\s]+)' . $limit . '@', "<$mark>\\1</$mark>", $res);
-               }
                $res = preg_replace("@<pre>-- ?\n@", "<pre>\n-- \n", $res);
         $parts = preg_split("/\n-- ?\n/", $res);
     }