fix js issue in markdown mimetype wikis if content contains quotes
This commit is contained in:
		| @@ -234,10 +234,8 @@ class Wiki extends \Zotlabs\Web\Controller { | |||||||
|  |  | ||||||
| 				$mimeType = $p['mimeType']; | 				$mimeType = $p['mimeType']; | ||||||
|  |  | ||||||
| 				$rawContent = (($p['mimeType'] == 'text/bbcode')  | 				$rawContent = htmlspecialchars_decode(json_decode($p['content']),ENT_COMPAT); | ||||||
| 					? htmlspecialchars_decode(json_decode($p['content']),ENT_COMPAT)  |  | ||||||
| 					: htmlspecialchars_decode($p['content'],ENT_COMPAT) |  | ||||||
| 				); |  | ||||||
| 				$content = ($p['content'] !== '' ? $rawContent : '"# New page\n"'); | 				$content = ($p['content'] !== '' ? $rawContent : '"# New page\n"'); | ||||||
| 				// Render the Markdown-formatted page content in HTML | 				// Render the Markdown-formatted page content in HTML | ||||||
| 				if($mimeType == 'text/bbcode') { | 				if($mimeType == 'text/bbcode') { | ||||||
| @@ -245,7 +243,7 @@ class Wiki extends \Zotlabs\Web\Controller { | |||||||
| 				} | 				} | ||||||
| 				else { | 				else { | ||||||
| 					require_once('library/markdown.php'); | 					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); | 					$renderedContent = Zlib\NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName); | ||||||
| 				} | 				} | ||||||
| 				$showPageControls = $wiki_editor; | 				$showPageControls = $wiki_editor; | ||||||
|   | |||||||
| @@ -107,7 +107,7 @@ | |||||||
| <script> | <script> | ||||||
| 	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 = {{if !$mimeType || $mimeType == 'text/markdown'}}{{$content}}{{else}}`{{$content}}`{{/if}}; | 	window.wiki_page_content = `{{$content}}`; | ||||||
| 	window.wiki_page_commit = '{{$commit}}'; | 	window.wiki_page_commit = '{{$commit}}'; | ||||||
|  |  | ||||||
| 	$("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary'); | 	$("#generic-modal-ok-{{$wikiModalID}}").removeClass('btn-primary'); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user