aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-02-27 13:52:08 +0100
committerMario Vavti <mario@mariovavti.com>2017-02-27 13:52:08 +0100
commita6d13f290b235b5c4a511079b622866573e8d2e3 (patch)
treec35bf47f07a4e61b9602d4b13bb961138b7bb550
parentb6cad08273f87b22c020f11242a4ef2797cffbe1 (diff)
downloadvolse-hubzilla-a6d13f290b235b5c4a511079b622866573e8d2e3.tar.gz
volse-hubzilla-a6d13f290b235b5c4a511079b622866573e8d2e3.tar.bz2
volse-hubzilla-a6d13f290b235b5c4a511079b622866573e8d2e3.zip
fix js issue in markdown mimetype wikis if content contains quotes
-rw-r--r--Zotlabs/Module/Wiki.php8
-rw-r--r--view/tpl/wiki.tpl2
2 files changed, 4 insertions, 6 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 32b484eea..15806ffc3 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -234,10 +234,8 @@ class Wiki extends \Zotlabs\Web\Controller {
$mimeType = $p['mimeType'];
- $rawContent = (($p['mimeType'] == 'text/bbcode')
- ? htmlspecialchars_decode(json_decode($p['content']),ENT_COMPAT)
- : htmlspecialchars_decode($p['content'],ENT_COMPAT)
- );
+ $rawContent = htmlspecialchars_decode(json_decode($p['content']),ENT_COMPAT);
+
$content = ($p['content'] !== '' ? $rawContent : '"# New page\n"');
// Render the Markdown-formatted page content in HTML
if($mimeType == 'text/bbcode') {
@@ -245,7 +243,7 @@ class Wiki extends \Zotlabs\Web\Controller {
}
else {
require_once('library/markdown.php');
- $html = Zlib\NativeWikiPage::generate_toc(zidify_text(purify_html(Markdown(Zlib\NativeWikiPage::bbcode(json_decode($content))))));
+ $html = Zlib\NativeWikiPage::generate_toc(zidify_text(purify_html(Markdown(Zlib\NativeWikiPage::bbcode($content)))));
$renderedContent = Zlib\NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName);
}
$showPageControls = $wiki_editor;
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index af6b6800e..ea31c23a3 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -107,7 +107,7 @@
<script>
window.wiki_resource_id = '{{$resource_id}}';
window.wiki_page_name = '{{$page}}';
- window.wiki_page_content = {{if !$mimeType || $mimeType == 'text/markdown'}}{{$content}}{{else}}`{{$content}}`{{/if}};
+ window.wiki_page_content = `{{$content}}`;
window.wiki_page_commit = '{{$commit}}';
$("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary');