diff options
author | Mario <mario@mariovavti.com> | 2024-02-09 11:20:46 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-02-09 11:20:46 +0000 |
commit | 067a66b9278e3c8ff2c624f38f2817715eb8a316 (patch) | |
tree | 61ef1bf5cec4c5840df78483819b246767f349b1 /include/bbcode.php | |
parent | 096fad5e8c71aea99d469b844d99fe9c9d58bc77 (diff) | |
download | volse-hubzilla-067a66b9278e3c8ff2c624f38f2817715eb8a316.tar.gz volse-hubzilla-067a66b9278e3c8ff2c624f38f2817715eb8a316.tar.bz2 volse-hubzilla-067a66b9278e3c8ff2c624f38f2817715eb8a316.zip |
fix some whitespace issues after recent changes
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index fb10ceb4a..a1e56b15f 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1384,32 +1384,32 @@ function bbcode($Text, $options = []) { // Check for h1 if (strpos($Text,'[h1]') !== false) { $Text = preg_replace("(\[h1\](.*?)\[\/h1\])ism",'<h1>$1</h1>',$Text); - $Text = str_replace('</h1><br />', '</h1>', $Text); + $Text = str_replace(["</h1>\n\n", "</h1>\n"], '</h1>', $Text); } // Check for h2 if (strpos($Text,'[h2]') !== false) { $Text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'<h2>$1</h2>',$Text); - $Text = str_replace('</h2><br />', '</h2>', $Text); + $Text = str_replace(["</h2>\n\n", "</h2>\n"], '</h2>', $Text); } // Check for h3 if (strpos($Text,'[h3]') !== false) { $Text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'<h3>$1</h3>',$Text); - $Text = str_replace('</h3><br />', '</h3>', $Text); + $Text = str_replace(["</h3>\n\n", "</h3>\n"], '</h3>', $Text); } // Check for h4 if (strpos($Text,'[h4]') !== false) { $Text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'<h4>$1</h4>',$Text); - $Text = str_replace('</h4><br />', '</h4>', $Text); + $Text = str_replace(["</h4>\n\n", "</h4>\n"], '</h4>', $Text); } // Check for h5 if (strpos($Text,'[h5]') !== false) { $Text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'<h5>$1</h5>',$Text); - $Text = str_replace('</h5><br />', '</h5>', $Text); + $Text = str_replace(["</h5>\n\n", "</h5>\n"], '</h5>', $Text); } // Check for h6 if (strpos($Text,'[h6]') !== false) { $Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'<h6>$1</h6>',$Text); - $Text = str_replace('</h6><br />', '</h6>', $Text); + $Text = str_replace(["</h6>\n\n", "</h6>\n"], '</h6>', $Text); } // Check for table of content without params @@ -1726,10 +1726,10 @@ function bbcode($Text, $options = []) { // We'll emulate it. $Text = str_replace("\r\n", "\n", $Text); - $Text = str_replace(array("\r", "\n"), array('<br />', '<br />'), $Text); + $Text = str_replace(["\r", "\n"], '<br />', $Text); - if ($preserve_nl) - $Text = str_replace(array("\n", "\r"), array('', ''), $Text); +// if ($preserve_nl) +// $Text = str_replace(array("\n", "\r"), array('', ''), $Text); call_hooks('bbcode', $Text); |