From 7124c0aee5486aab74272c81ceb3e383b2e3a7f7 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Thu, 30 Jun 2016 21:50:38 -0400 Subject: Replace homemade table of content generator with existing jQuery plugin. Now toc is linked to document headings. --- Zotlabs/Module/Wiki.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index a5039fa23..f30884bfb 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -126,8 +126,7 @@ class Wiki extends \Zotlabs\Web\Controller { $content = ($p['content'] !== '' ? $p['content'] : '"# New page\n"'); // Render the Markdown-formatted page content in HTML require_once('library/markdown.php'); - $toc_content = wiki_generate_toc(json_decode($content)); - $html = purify_html(Markdown($toc_content)); + $html = wiki_generate_toc(purify_html(Markdown(json_decode($content)))); $renderedContent = wiki_convert_links($html,argv(0).'/'.argv(1).'/'.$wikiUrlName); $hide_editor = false; $showPageControls = $wiki_editor; @@ -200,8 +199,7 @@ class Wiki extends \Zotlabs\Web\Controller { $content = $_POST['content']; $resource_id = $_POST['resource_id']; require_once('library/markdown.php'); - $content = wiki_generate_toc($content); - $html = purify_html(Markdown($content)); + $html = wiki_generate_toc(purify_html(Markdown($content))); $w = wiki_get_wiki($resource_id); $wikiURL = argv(0).'/'.argv(1).'/'.$w['urlName']; $html = wiki_convert_links($html,$wikiURL); -- cgit v1.2.3