aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Wiki.php
diff options
context:
space:
mode:
authorhubzilla <git@macgirvin.com>2016-07-01 11:57:48 +1000
committerGitHub <noreply@github.com>2016-07-01 11:57:48 +1000
commiteef8f3b417ef90977649b1a39c98f299be4b5bce (patch)
treeb6684b05aee92729406a90f397ccd446f58863c7 /Zotlabs/Module/Wiki.php
parent852b2659e9a71f0542e822aa20efc009e22ff66a (diff)
parent0fd8eeec23a0613db8ea6c5bb54b4658ddaa0e61 (diff)
downloadvolse-hubzilla-eef8f3b417ef90977649b1a39c98f299be4b5bce.tar.gz
volse-hubzilla-eef8f3b417ef90977649b1a39c98f299be4b5bce.tar.bz2
volse-hubzilla-eef8f3b417ef90977649b1a39c98f299be4b5bce.zip
Merge pull request #445 from anaqreon/wiki
Table of contents with links is generated if [toc] is found in Markdown text
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r--Zotlabs/Module/Wiki.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 2f22f0a81..6252f7a1a 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -138,7 +138,8 @@ class Wiki extends \Zotlabs\Web\Controller {
$content = ($p['content'] !== '' ? htmlspecialchars_decode($p['content'],ENT_COMPAT) : '"# New page\n"');
// Render the Markdown-formatted page content in HTML
require_once('library/markdown.php');
- $renderedContent = wiki_convert_links(Markdown(json_decode($content)),argv(0).'/'.argv(1).'/'.$wikiUrlName);
+ $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;
$showNewWikiButton = $wiki_owner;
@@ -215,7 +216,7 @@ class Wiki extends \Zotlabs\Web\Controller {
$content = $_POST['content'];
$resource_id = $_POST['resource_id'];
require_once('library/markdown.php');
- $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);