diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index c59755445..89bd80202 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1403,12 +1403,32 @@ class BBCode } // Check for headers - $text = preg_replace("(\[h1\](.*?)\[\/h1\])ism", '
', $text); - $text = preg_replace("(\[h2\](.*?)\[\/h2\])ism", '
', $text); - $text = preg_replace("(\[h3\](.*?)\[\/h3\])ism", '
', $text); - $text = preg_replace("(\[h4\](.*?)\[\/h4\])ism", '
', $text); - $text = preg_replace("(\[h5\](.*?)\[\/h5\])ism", '
', $text); - $text = preg_replace("(\[h6\](.*?)\[\/h6\])ism", '
', $text); + + if ($simple_html == self::INTERNAL) { + //Ensure to always start with
", $text); + $heading--; + } + } + } + } else { + $text = preg_replace("(\[h1\](.*?)\[\/h1\])ism", '
', $text); + $text = preg_replace("(\[h2\](.*?)\[\/h2\])ism", '
', $text); + $text = preg_replace("(\[h3\](.*?)\[\/h3\])ism", '
', $text); + $text = preg_replace("(\[h4\](.*?)\[\/h4\])ism", '
', $text); + $text = preg_replace("(\[h5\](.*?)\[\/h5\])ism", '
', $text); + $text = preg_replace("(\[h6\](.*?)\[\/h6\])ism", '
', $text); + } // Check for paragraph $text = preg_replace("(\[p\](.*?)\[\/p\])ism", '
$1
', $text);