even more fine tuning of the markdown purifier - especially when used with the wiki

This commit is contained in:
zotlabs 2017-03-20 19:41:03 -07:00 committed by Mario Vavti
parent 5915f31950
commit e97dd48b4c
4 changed files with 4 additions and 3 deletions

View File

@ -81,7 +81,7 @@ class MarkdownSoap {
$s = str_replace("\t",'    ',$s); $s = str_replace("\t",'    ',$s);
$s = str_replace(' ',' ',$s); $s = str_replace(' ',' ',$s);
$s = purify_html($s); $s = purify_html($s);
$s = str_replace(' '," ",$s); $s = str_replace([' ', mb_convert_encoding(' ','UTF-8','HTML-ENTITIES')], [ ' ', ' ' ],$s);
$s = str_replace(['<br>','<br />'],["\n","\n"],$s); $s = str_replace(['<br>','<br />'],["\n","\n"],$s);
return $s; return $s;
} }

View File

@ -156,7 +156,7 @@ class NativeWikiPage {
$content = $item['body']; $content = $item['body'];
return [ return [
'content' => json_encode($content), 'content' => $content,
'mimeType' => $w['mimeType'], 'mimeType' => $w['mimeType'],
'message' => '', 'message' => '',
'success' => true 'success' => true

View File

@ -256,6 +256,7 @@ class Wiki extends \Zotlabs\Web\Controller {
goaway('/' . argv(0) . '/' . argv(1) . '/' . $wikiUrlName . '/' . $pageUrlName); goaway('/' . argv(0) . '/' . argv(1) . '/' . $wikiUrlName . '/' . $pageUrlName);
} }
$wikiModalID = random_string(3); $wikiModalID = random_string(3);
$wikiModal = replace_macros(get_markup_template('generic_modal.tpl'), array( $wikiModal = replace_macros(get_markup_template('generic_modal.tpl'), array(

View File

@ -104,7 +104,7 @@
window.wiki_resource_id = '{{$resource_id}}'; window.wiki_resource_id = '{{$resource_id}}';
window.wiki_page_name = '{{$page}}'; window.wiki_page_name = '{{$page}}';
// window.wiki_page_content = "{{$content|escape:'javascript'}}"; // window.wiki_page_content = "{{$content|escape:'javascript'}}";
window.wiki_page_content = {{$content}}; window.wiki_page_content = '{{$content|escape:'quotes'}}';
window.wiki_page_commit = '{{$commit}}'; window.wiki_page_commit = '{{$commit}}';
$("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary'); $("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary');