aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-25 21:42:50 +0100
committerMario <mario@mariovavti.com>2024-03-25 21:42:50 +0100
commit53354a19304c932beea484e387d2c9536786e258 (patch)
tree7827621824a9d794de634896c775cc8988c5224c /include/bbcode.php
parent3c0d6339bb12bd7fbf65ba7a79078e39737b4387 (diff)
downloadvolse-hubzilla-53354a19304c932beea484e387d2c9536786e258.tar.gz
volse-hubzilla-53354a19304c932beea484e387d2c9536786e258.tar.bz2
volse-hubzilla-53354a19304c932beea484e387d2c9536786e258.zip
more remove additional linebreaks after block element plus test
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 1ced24ec3..844717572 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1287,6 +1287,11 @@ function bbcode($text, $options = []) {
if (strpos($text,'[pre]') !== false) {
$text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$text);
}
+
+ if (strpos($text,'</pre>') !== false) {
+ $text = str_replace(["</pre>\r", "</pre>\n"], '</pre>', $text);
+ }
+
if (strpos($text,'[summary]') !== false) {
$text = preg_replace_callback("/\[summary\](.*?)\[\/summary\]/ism", 'bb_spacefy',$text);
}