From c444e40c016c0faaec604335093b19661b3585b7 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 18 Feb 2018 10:09:05 -0500 Subject: Update code tag styling so bbcode [code] blocks and wiki markdown inline code render nicely. --- include/bbcode.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index 0c85a0a4e..86fd24696 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -628,7 +628,7 @@ function bb_code_unprotect_sub($match) { function bb_code($match) { if(strpos($match[0], "
")) - return '' . bb_code_protect(trim($match[1])) . ''; + return '
' . bb_code_protect(trim($match[1])) . '
'; else return '' . bb_code_protect(trim($match[1])) . ''; } @@ -636,15 +636,21 @@ function bb_code($match) { function bb_code_options($match) { if(strpos($match[0], "
")) { $class = ""; + $pre = true; } else { $class = "inline-code"; + $pre = false; } if(strpos($match[1], 'nowrap')) { $style = "overflow-x: auto; white-space: pre;"; } else { $style = ""; } - return '' . bb_code_protect(trim($match[2])) . ''; + if($pre) { + return '
' . bb_code_protect(trim($match[2])) . '
'; + } else { + return '' . bb_code_protect(trim($match[2])) . ''; + } } function bb_highlight($match) { -- cgit v1.2.3