more whitespace fixes and some docu

This commit is contained in:
Mario
2024-03-21 09:47:34 +00:00
parent 66f5b34c07
commit 49509e7347
2 changed files with 12 additions and 6 deletions

View File

@@ -1440,32 +1440,32 @@ function bbcode($text, $options = []) {
// Check for h1 // Check for h1
if (strpos($text,'[h1]') !== false) { if (strpos($text,'[h1]') !== false) {
$text = preg_replace("(\[h1\](.*?)\[\/h1\])ism",'<h1>$1</h1>',$text); $text = preg_replace("(\[h1\](.*?)\[\/h1\])ism",'<h1>$1</h1>',$text);
$text = str_replace(["</h1>\n\n", "</h1>\n"], '</h1>', $text); $text = str_replace(["</h1>\r", "</h1>\n"], '</h1>', $text);
} }
// Check for h2 // Check for h2
if (strpos($text,'[h2]') !== false) { if (strpos($text,'[h2]') !== false) {
$text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'<h2>$1</h2>',$text); $text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'<h2>$1</h2>',$text);
$text = str_replace(["</h2>\n\n", "</h2>\n"], '</h2>', $text); $text = str_replace(["</h2>\r", "</h2>\n"], '</h2>', $text);
} }
// Check for h3 // Check for h3
if (strpos($text,'[h3]') !== false) { if (strpos($text,'[h3]') !== false) {
$text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'<h3>$1</h3>',$text); $text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'<h3>$1</h3>',$text);
$text = str_replace(["</h3>\n\n", "</h3>\n"], '</h3>', $text); $text = str_replace(["</h3>\r", "</h3>\n"], '</h3>', $text);
} }
// Check for h4 // Check for h4
if (strpos($text,'[h4]') !== false) { if (strpos($text,'[h4]') !== false) {
$text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'<h4>$1</h4>',$text); $text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'<h4>$1</h4>',$text);
$text = str_replace(["</h4>\n\n", "</h4>\n"], '</h4>', $text); $text = str_replace(["</h4>\r", "</h4>\n"], '</h4>', $text);
} }
// Check for h5 // Check for h5
if (strpos($text,'[h5]') !== false) { if (strpos($text,'[h5]') !== false) {
$text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'<h5>$1</h5>',$text); $text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'<h5>$1</h5>',$text);
$text = str_replace(["</h5>\n\n", "</h5>\n"], '</h5>', $text); $text = str_replace(["</h5>\r", "</h5>\n"], '</h5>', $text);
} }
// Check for h6 // Check for h6
if (strpos($text,'[h6]') !== false) { if (strpos($text,'[h6]') !== false) {
$text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'<h6>$1</h6>',$text); $text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'<h6>$1</h6>',$text);
$text = str_replace(["</h6>\n\n", "</h6>\n"], '</h6>', $text); $text = str_replace(["</h6>\r", "</h6>\n"], '</h6>', $text);
} }
// Check for table of content without params // Check for table of content without params
@@ -1507,6 +1507,8 @@ function bbcode($text, $options = []) {
((strpos($text, "[/dl]") !== false) && (strpos($text, "[dl") !== false)) || ((strpos($text, "[/dl]") !== false) && (strpos($text, "[dl") !== false)) ||
((strpos($text, "[/li]") !== false) && (strpos($text, "[li]") !== false))) && (++$endlessloop < 20)) { ((strpos($text, "[/li]") !== false) && (strpos($text, "[li]") !== false))) && (++$endlessloop < 20)) {
$text = str_replace(["[/list]\r", "[/list]\n"], '[/list]', $text);
$text = preg_replace_callback("/\[list\](.*?)\[\/list\]/ism",'bb_fix_lf', $text); $text = preg_replace_callback("/\[list\](.*?)\[\/list\]/ism",'bb_fix_lf', $text);
$text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet">$1</ul>', $text); $text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet">$1</ul>', $text);

View File

@@ -1,3 +1,7 @@
// To compiled custom site bootstrap from sass,
// run this script from the document root for an example:
// php vendor/bin/pscss view/theme/redbasic/css/sample.scss view/theme/redbasic/css/bootstrap-custom.css
// See https://getbootstrap.com/docs/5.3/customize/sass/ for more infos // See https://getbootstrap.com/docs/5.3/customize/sass/ for more infos
// required import // required import