Replace Mardownify library with html-to-markdown library.

This commit is contained in:
Klaus Weidenbach
2017-05-23 00:32:11 +02:00
parent 50e9d02458
commit 547df2219a
44 changed files with 2379 additions and 3359 deletions

View File

@@ -5,7 +5,7 @@
*/
use Michelf\MarkdownExtra;
use Markdownify\Converter;
use League\HTMLToMarkdown\HtmlConverter;
require_once("include/oembed.php");
require_once("include/event.php");
@@ -495,9 +495,8 @@ function bb2diaspora($Text, $preserve_nl = false, $fordiaspora = true) {
$Text = str_replace(array('<','>','&'),array('&_lt_;','&_gt_;','&_amp_;'),$Text);
// Now convert HTML to Markdown
$md = new Converter(Converter::LINK_AFTER_CONTENT, false, false);
$Text = $md->parseString($Text);
$md = new HtmlConverter();
$Text = $md->convert($Text);
// It also adds backslashes to our attempt at getting around the html entity preservation for some weird reason.