<?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
*
// 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);
$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', []);
// 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);