fixed [code] bbcode linebreaking nbsp; stuff.

git-svn-id: file:///svn/phpbb/trunk@1520 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
natec 2001-12-06 23:39:16 +00:00
parent dd8d0ddc6d
commit 0a41688fa1

View file

@ -225,6 +225,7 @@ mt_srand( (double) microtime() * 1000000);
function make_bbcode_uid() function make_bbcode_uid()
{ {
// Unique ID for this message.. // Unique ID for this message..
$uid = md5(mt_rand()); $uid = md5(mt_rand());
$uid = substr($uid, 0, BBCODE_UID_LEN); $uid = substr($uid, 0, BBCODE_UID_LEN);
@ -537,11 +538,10 @@ function bbencode_second_pass_code($text, $uid, $bbcode_tpl)
$after_replace = preg_replace($html_entities_match, $html_entities_replace, $after_replace); $after_replace = preg_replace($html_entities_match, $html_entities_replace, $after_replace);
// Replace all spaces with non-breaking spaces. // Replace 2 spaces with "  " so non-tabbed code indents without making huge long lines.
$after_replace = str_replace(" ", "  ", $after_replace);
// now Replace 2 spaces with "  " to catch odd #s of spaces.
$after_replace = str_replace(" ", "  ", $after_replace); $after_replace = str_replace(" ", "  ", $after_replace);
// Replace 3 nbsp's with "   " so non-tabbed code indents without making huge long lines.
$after_replace = str_replace("   ", "   ", $after_replace);
// Replace tabs with "   " so tabbed code indents sorta right without making huge long lines. // Replace tabs with "   " so tabbed code indents sorta right without making huge long lines.
$after_replace = str_replace("\t", "   ", $after_replace); $after_replace = str_replace("\t", "   ", $after_replace);