bring back the markdown post feature (after investing some effort to make it work)
This commit is contained in:
@@ -363,6 +363,15 @@ function get_features($filtered = true) {
|
||||
|
||||
t('Post/Comment Tools'),
|
||||
|
||||
[
|
||||
'markdown',
|
||||
t('Markdown'),
|
||||
t('Use markdown for editing posts'),
|
||||
false,
|
||||
get_config('feature_lock','markdown'),
|
||||
feature_level('markdown',2),
|
||||
],
|
||||
|
||||
[
|
||||
'commtag',
|
||||
t('Community Tagging'),
|
||||
|
||||
@@ -49,14 +49,17 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) {
|
||||
|
||||
$s = $x['text'];
|
||||
|
||||
// Escaping the hash tags - doesn't always seem to work
|
||||
// $s = preg_replace('/\#([^\s\#])/','\\#$1',$s);
|
||||
// This seems to work
|
||||
// Escaping the hash tags
|
||||
$s = preg_replace('/\#([^\s\#])/','#$1',$s);
|
||||
|
||||
$s = MarkdownExtra::defaultTransform($s);
|
||||
|
||||
$s = str_replace("\r","",$s);
|
||||
if($options && $options['preserve_lf']) {
|
||||
$s = str_replace(["\r","\n"],["",'<br>'],$s);
|
||||
}
|
||||
else {
|
||||
$s = str_replace("\r","",$s);
|
||||
}
|
||||
|
||||
$s = str_replace('#','#',$s);
|
||||
|
||||
|
||||
@@ -716,6 +716,10 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
|
||||
$scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]);
|
||||
else
|
||||
$scaled = $mtch[3];
|
||||
|
||||
if(! strpbrk(substr($scaled,0,1),'zhfmt'))
|
||||
continue;
|
||||
|
||||
$i = z_fetch_url($scaled,true);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user