mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00: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:
parent
74a9b88c06
commit
e1d1cb0c32
1 changed files with 9 additions and 0 deletions
|
@ -534,6 +534,15 @@ 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.
|
||||||
|
$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]";
|
$str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]";
|
||||||
|
|
||||||
$replacement = $code_start_html;
|
$replacement = $code_start_html;
|
||||||
|
|
Loading…
Add table
Reference in a new issue