aboutsummaryrefslogtreecommitdiffstats
path: root/include/help.php
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-02-25 19:12:41 +0100
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-02-27 23:40:29 +0100
commit503c368f9ec08a70e4dbacd7b729568da6e4ea92 (patch)
tree94222fe6380f9d7311a41c398d7ffd28594b15d6 /include/help.php
parent2848d1caaf48a33ab1fb9a0c7de534287107e57e (diff)
downloadvolse-hubzilla-503c368f9ec08a70e4dbacd7b729568da6e4ea92.tar.gz
volse-hubzilla-503c368f9ec08a70e4dbacd7b729568da6e4ea92.tar.bz2
volse-hubzilla-503c368f9ec08a70e4dbacd7b729568da6e4ea92.zip
:arrow_up: :hammer: Upgrade PHP Markdown library.
The current version throws deprecated warning with PHP7.1 and PHPUnit. Upgrade the Markdown library to the current PHP Markdown Lib 1.7.0. Used composer to manage this library.
Diffstat (limited to 'include/help.php')
-rw-r--r--include/help.php16
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;
}