projects
/
banana.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Place formatting before html conversion of the article in order to avoid // matching...
[banana.git]
/
banana
/
misc.inc.php
diff --git
a/banana/misc.inc.php
b/banana/misc.inc.php
index
8d905e3
..
ece2883
100644
(file)
--- a/
banana/misc.inc.php
+++ b/
banana/misc.inc.php
@@
-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";
$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;
if ($format != 'html') {
global $banana;
@@
-484,7
+490,7
@@
function formatbody($_text, $format='plain', $flowed=false)
.".'</pre></blockquote><pre>'",
$res);
}
.".'</pre></blockquote><pre>'",
$res);
}
- $res = preg_replace("@<pre>-- ?\n@", "<pre>\n-- \n", $res);
+
$res = preg_replace("@<pre>-- ?\n@", "<pre>\n-- \n", $res);
$parts = preg_split("/\n-- ?\n/", $res);
}
$parts = preg_split("/\n-- ?\n/", $res);
}