diff options
author | zotlabs <mike@macgirvin.com> | 2017-03-01 09:54:01 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-01 09:54:01 +1100 |
commit | fa02f3a1089975319df5a223c730f0f0249fd4bb (patch) | |
tree | 881bb6a3ccba460503d83fb84ed26eb210070cf0 /include/help.php | |
parent | 360397b2ed849521638428a51b1bb1d68389ad4a (diff) | |
parent | 503c368f9ec08a70e4dbacd7b729568da6e4ea92 (diff) | |
download | volse-hubzilla-fa02f3a1089975319df5a223c730f0f0249fd4bb.tar.gz volse-hubzilla-fa02f3a1089975319df5a223c730f0f0249fd4bb.tar.bz2 volse-hubzilla-fa02f3a1089975319df5a223c730f0f0249fd4bb.zip |
Merge pull request #686 from dawnbreak/markdown
Upgrade PHP Markdown library.
Diffstat (limited to 'include/help.php')
-rw-r--r-- | include/help.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/help.php b/include/help.php index 6e779f000..e4725575d 100644 --- a/include/help.php +++ b/include/help.php @@ -1,5 +1,7 @@ <?php +use \Michelf\MarkdownExtra; + /** * @brief * @@ -15,7 +17,7 @@ function get_help_content($tocpath = false) { $text = ''; $path = (($tocpath !== false) ? $tocpath : ''); - + if($tocpath === false && argc() > 1) { $path = ''; for($x = 1; $x < argc(); $x ++) { @@ -55,7 +57,7 @@ function get_help_content($tocpath = false) { if(! $text) { $doctype = 'bbcode'; $text = load_doc_file('doc/main.bb'); - goaway('/help/about/about_hubzilla'); + goaway('/help/about/about_hubzilla'); \App::$page['title'] = t('Help'); } @@ -69,12 +71,11 @@ function get_help_content($tocpath = false) { } if($doctype === 'html') - $content = parseIdentityAwareHTML($text); - if($doctype === 'markdown') { - require_once('library/markdown.php'); + $content = parseIdentityAwareHTML($text); + if($doctype === 'markdown') { # escape #include tags $text = preg_replace('/#include/ism', '%%include', $text); - $content = Markdown($text); + $content = MarkdownExtra::defaultTransform($text); $content = preg_replace('/%%include/ism', '#include', $content); } if($doctype === 'bbcode') { @@ -99,8 +100,7 @@ function preg_callback_help_include($matches) { $include = str_replace(' target="_blank"','',$include); } elseif(preg_match('/\.md$/', $matches[1])) { - require_once('library/markdown.php'); - $include = Markdown($include); + $include = MarkdownExtra::defaultTransform($include); } return $include; } |