From 64fe15b6f5813ba860034f583f8014f63951931d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 21 Dec 2017 09:07:37 +0100 Subject: remove additional linebreaks after headings --- include/bbcode.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index ed34bc5d6..775a91f9a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -941,27 +941,34 @@ function bbcode($Text, $options = []) { // Check for h1 if (strpos($Text,'[h1]') !== false) { $Text = preg_replace("(\[h1\](.*?)\[\/h1\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h2 if (strpos($Text,'[h2]') !== false) { $Text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h3 if (strpos($Text,'[h3]') !== false) { $Text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h4 if (strpos($Text,'[h4]') !== false) { $Text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h5 if (strpos($Text,'[h5]') !== false) { $Text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'
$1
',$Text); + $Text = str_replace('
', '', $Text); } // Check for h6 if (strpos($Text,'[h6]') !== false) { $Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'
$1
',$Text); + $Text = str_replace('
', '', $Text); } + // Check for table of content without params while(strpos($Text,'[toc]') !== false) { $toc_id = 'toc-' . random_string(10); -- cgit v1.2.3