Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge

This commit is contained in:
zotlabs
2017-05-23 16:14:41 -07:00
46 changed files with 2383 additions and 3362 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");
@@ -177,10 +177,12 @@ function bb_to_markdown($Text) {
$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);
// The converter adds backslashes to our attempt at getting around the html entity preservation for some weird reason.
$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.
$Text = str_replace(array('&\\_lt\\_;','&\\_gt\\_;','&\\_amp\\_;'),array('<','>','&'),$Text);