(.*?)\<\;br\>\;(.*?)\<\/code\>/ism','$1
$2
',$Text);
+ } while ($replaced != $Text);
+
+ // bbcode code blocks are wrapped in . Do the same for markdown code blocks so that the styling is consistent
+
+ $Text = str_replace([ '', '
' ], [ '', '
' ] , $Text);
+
+ $Text = str_replace('&_lt;br&_gt;','<br>', $Text);
+
+ // END markdown quirks
$Text = str_replace(array("\t", " "), array(" ", " "), $Text);
-
// Check for [code] text
if (strpos($Text,'[code]') !== false) {
$Text = preg_replace_callback("/\[code\](.*?)\[\/code\]/ism", 'bb_code', $Text);