diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-06-30 21:50:38 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-06-30 21:50:38 -0400 |
commit | 7124c0aee5486aab74272c81ceb3e383b2e3a7f7 (patch) | |
tree | d556c7638dbfbc1deef6a2ff10c2105fa2c18dd7 /Zotlabs/Module | |
parent | 81da9f99e4ee111623a1ba302a6ab18e369756e9 (diff) | |
download | volse-hubzilla-7124c0aee5486aab74272c81ceb3e383b2e3a7f7.tar.gz volse-hubzilla-7124c0aee5486aab74272c81ceb3e383b2e3a7f7.tar.bz2 volse-hubzilla-7124c0aee5486aab74272c81ceb3e383b2e3a7f7.zip |
Replace homemade table of content generator with existing jQuery plugin. Now toc is linked to document headings.
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Wiki.php | 6 |
1 files changed, 2 insertions, 4 deletions
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); |