move markdown-in-posts/comments feature to plugin
This commit is contained in:
parent
f0faa7f9b0
commit
91db66b32d
@ -504,7 +504,12 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
$body = z_input_filter($body,$mimetype,$execflag);
|
$body = z_input_filter($body,$mimetype,$execflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify ability to use html or php!!!
|
|
||||||
|
$arr = [ 'profile_uid' => $profile_uid, 'content' => $body, 'mimetype' => $mimetype ];
|
||||||
|
call_hooks('post_content',$arr);
|
||||||
|
$body = $arr['content'];
|
||||||
|
$mimetype = $arr['mimetype'];
|
||||||
|
|
||||||
|
|
||||||
$gacl = $acl->get();
|
$gacl = $acl->get();
|
||||||
$str_contact_allow = $gacl['allow_cid'];
|
$str_contact_allow = $gacl['allow_cid'];
|
||||||
@ -516,13 +521,6 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
require_once('include/text.php');
|
require_once('include/text.php');
|
||||||
|
|
||||||
if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
|
|
||||||
require_once('include/markdown.php');
|
|
||||||
$body = preg_replace_callback('/\[share(.*?)\]/ism','\share_shield',$body);
|
|
||||||
$body = markdown_to_bb($body,true,['preserve_lf' => true]);
|
|
||||||
$body = preg_replace_callback('/\[share(.*?)\]/ism','\share_unshield',$body);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// BBCODE alert: the following functions assume bbcode input
|
// BBCODE alert: the following functions assume bbcode input
|
||||||
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
|
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
|
||||||
|
@ -373,15 +373,6 @@ function get_features($filtered = true) {
|
|||||||
|
|
||||||
t('Post/Comment Tools'),
|
t('Post/Comment Tools'),
|
||||||
|
|
||||||
[
|
|
||||||
'markdown',
|
|
||||||
t('Markdown'),
|
|
||||||
t('Use markdown for editing posts'),
|
|
||||||
false,
|
|
||||||
get_config('feature_lock','markdown'),
|
|
||||||
feature_level('markdown',2),
|
|
||||||
],
|
|
||||||
|
|
||||||
[
|
[
|
||||||
'commtag',
|
'commtag',
|
||||||
t('Community Tagging'),
|
t('Community Tagging'),
|
||||||
@ -490,6 +481,8 @@ function get_features($filtered = true) {
|
|||||||
else {
|
else {
|
||||||
$narr = $arr;
|
$narr = $arr;
|
||||||
}
|
}
|
||||||
call_hooks('get_features',$narr);
|
|
||||||
return $narr;
|
$x = [ 'features' => $narr, 'filtered' => $filtered, 'techlevel' => $techlevel ];
|
||||||
|
call_hooks('get_features',$x);
|
||||||
|
return $x['features'];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user