aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-05 11:02:19 -0800
committerzotlabs <mike@macgirvin.com>2017-03-05 11:02:19 -0800
commit384db9d10dbded64e83564daa4c51dac05674a2b (patch)
tree9f878ae892650ac124f073b129190d9801c3e4a8 /include
parentb2ea61ea3e389cd3ca36a656e6165fb3500035e5 (diff)
parent5d8b0acc167a8028d3476ba468223da8c6f1a276 (diff)
downloadvolse-hubzilla-384db9d10dbded64e83564daa4c51dac05674a2b.tar.gz
volse-hubzilla-384db9d10dbded64e83564daa4c51dac05674a2b.tar.bz2
volse-hubzilla-384db9d10dbded64e83564daa4c51dac05674a2b.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include')
-rw-r--r--include/markdown.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/markdown.php b/include/markdown.php
index 43d973808..7e1f1c42c 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -5,12 +5,12 @@
*/
use Michelf\MarkdownExtra;
+use Markdownify\Converter;
require_once("include/oembed.php");
require_once("include/event.php");
require_once("include/html2bbcode.php");
require_once("include/bbcode.php");
-require_once("library/markdownify/markdownify.php");
function get_bb_tag_pos($s, $name, $occurance = 1) {
@@ -367,7 +367,6 @@ function bb2diaspora_itemwallwall(&$item,$uplink = false) {
function bb2diaspora_itembody($item, $force_update = false, $have_channel = false, $uplink = false) {
-
if(! get_iconfig($item,'diaspora','fields')) {
$force_update = true;
}
@@ -454,7 +453,7 @@ function bb2diaspora_itembody($item, $force_update = false, $have_channel = fals
return html_entity_decode($body);
}
-function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
+function bb2diaspora($Text, $preserve_nl = false, $fordiaspora = true) {
// Re-enabling the converter again.
// The bbcode parser now handles youtube-links (and the other stuff) correctly.
@@ -496,11 +495,10 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
$Text = str_replace(array('&lt;','&gt;','&amp;'),array('&_lt_;','&_gt_;','&_amp_;'),$Text);
// Now convert HTML to Markdown
- $md = new Markdownify(false, false, false);
+ $md = new Converter(Converter::LINK_AFTER_CONTENT, false, false);
$Text = $md->parseString($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('&lt;','&gt;','&amp;'),$Text);
@@ -522,7 +520,7 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
$Text = trim($Text);
- call_hooks('bb2diaspora',$Text);
+ call_hooks('bb2diaspora', $Text);
return $Text;
}