1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-01 14:32:54 +01:00

tabs-to-spaces and other indentation mojo for [code] bbcode.

git-svn-id: file:///svn/phpbb/trunk@1448 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
natec 2001-11-26 08:15:53 +00:00
parent 74a9b88c06
commit e1d1cb0c32

@ -533,6 +533,15 @@ function bbencode_second_pass_code($text, $uid, $bbcode_tpl)
$after_replace = $matches[1][$i];
$after_replace = preg_replace($html_entities_match, $html_entities_replace, $after_replace);
// Replace all spaces with non-breaking spaces.
$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.
$after_replace = str_replace("\t", "   ", $after_replace);
$str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]";