]> git.mxchange.org Git - friendica.git/commitdiff
HTML: Use paragraphs instead of double line breaks
authorMichael <heluecht@pirati.ca>
Fri, 17 Mar 2023 06:10:56 +0000 (06:10 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 17 Mar 2023 06:10:56 +0000 (06:10 +0000)
src/Content/Text/BBCode.php

index 33f91b43d11ed2b3fd31400eca4fcb19e27c9ae3..c9bbc02c934f414d68140c01c7ec8452c497bf2e 100644 (file)
@@ -1460,6 +1460,7 @@ class BBCode
                                // @deprecated since 2021.12, left for backward-compatibility reasons
                                $text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism", '<span class="$1">$2</span>', $text);
                                // Add HTML new lines
+                               $text = str_replace("\n\n", '</p><p>', $text);
                                $text = str_replace("\n", '<br>', $text);
 
                                // handle nested lists
@@ -1938,7 +1939,7 @@ class BBCode
                                : []
                );
 
-               $text = HTML::purify($text, $allowedIframeDomains);
+               $text = HTML::purify('<p>' . $text . '</p>', $allowedIframeDomains);
                DI::profiler()->stopRecording();
 
                return trim($text);