]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Text/BBCode.php
Continued:
[friendica.git] / src / Content / Text / BBCode.php
index fab4fba0234680184346be96e6dfcea2f49d192f..835a96e4d3b58c158b4fcaef3560f4edd6402af6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2023, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -291,7 +291,7 @@ class BBCode
                // Remove all unneeded white space
                do {
                        $oldtext = $text;
-                       $text = str_replace(['  ', "\n", "\r", '"', '_'], ' ', $text);
+                       $text = str_replace(['  ', "\n", "\r", '"'], ' ', $text);
                } while ($oldtext != $text);
 
                return trim($text);
@@ -1958,7 +1958,7 @@ class BBCode
                                        $text
                                );
 
-                               // sanitize href attributes (only allowlisted protocols URLs)
+                               // sanitize href attributes (only whitelisted protocols URLs)
                                // default value for backward compatibility
                                $allowed_link_protocols = DI::config()->get('system', 'allowed_link_protocols', []);
 
@@ -2171,6 +2171,9 @@ class BBCode
                // Maybe we should make this newline at every time before a quote.
                $text = str_replace(['</a><blockquote>'], ['</a><br><blockquote>'], $text);
 
+               // The converter doesn't convert these elements
+               $text = str_replace(['<div>', '</div>'], ['<p>', '</p>'], $text);
+
                // Now convert HTML to Markdown
                $text = HTML::toMarkdown($text);