* finish task #40312.
This commit is contained in:
@@ -2425,6 +2425,29 @@ EOD;
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process markdown.
|
||||
*
|
||||
* @param string $markdown
|
||||
* @static
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
static public function processMarkdown($markdown)
|
||||
{
|
||||
if(empty($markdown)) return false;
|
||||
|
||||
$markdown = str_replace('&', '&', $markdown);
|
||||
|
||||
global $app;
|
||||
$hyperdown = $app->loadClass('hyperdown');
|
||||
$content = $hyperdown->makeHtml($markdown);
|
||||
|
||||
$content = htmlspecialchars_decode($content);
|
||||
$content = fixer::stripDataTags($content);
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
class common extends commonModel
|
||||
|
||||
@@ -487,8 +487,8 @@ class doc extends control
|
||||
|
||||
if($doc->contentType == 'markdown')
|
||||
{
|
||||
$doc->content = $this->doc->processMarkdown($doc->content);
|
||||
$doc->digest = $this->doc->processMarkdown($doc->digest);
|
||||
$doc->content = commonModel::processMarkdown($doc->content);
|
||||
$doc->digest = commonModel::processMarkdown($doc->digest);
|
||||
}
|
||||
|
||||
/* Check priv when lib is product or project. */
|
||||
@@ -916,8 +916,8 @@ class doc extends control
|
||||
|
||||
if($doc->contentType == 'markdown')
|
||||
{
|
||||
$doc->content = $this->doc->processMarkdown($doc->content);
|
||||
$doc->digest = $this->doc->processMarkdown($doc->digest);
|
||||
$doc->content = commonModel::processMarkdown($doc->content);
|
||||
$doc->digest = commonModel::processMarkdown($doc->digest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1947,25 +1947,4 @@ class docModel extends model
|
||||
if(!isset($treeMenu[$module->parent])) $treeMenu[$module->parent] = '';
|
||||
$treeMenu[$module->parent] .= '<li' . ($treeMenu[$module->id] ? ' class="closed"' : '') . '>' . $li . '</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Process markdown.
|
||||
*
|
||||
* @param string $markdown
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function processMarkdown($markdown)
|
||||
{
|
||||
if(empty($markdown)) return false;
|
||||
|
||||
$markdown = str_replace('&', '&', $markdown);
|
||||
|
||||
$hyperdown = $this->app->loadClass('hyperdown');
|
||||
$content = $hyperdown->makeHtml($markdown);
|
||||
|
||||
$content = htmlspecialchars_decode($content);
|
||||
$content = fixer::stripDataTags($content);
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user