mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-21 03:12:55 +09:00
마크다운 에디터를 위한 추가
This commit is contained in:
parent
c72e2ad49f
commit
4ccbd62b67
1 changed files with 27 additions and 11 deletions
|
|
@ -878,30 +878,46 @@ class editorModel extends editor
|
|||
*/
|
||||
function convertHTML($obj)
|
||||
{
|
||||
$no_html = false;
|
||||
$type = array();
|
||||
$editor_config = $this->getEditorConfig($obj->module_srl);
|
||||
|
||||
if ($editor_config->allow_html === 'N')
|
||||
// Check
|
||||
if ($editor_config->allow_html === 'N' || $obj->use_html === 'N')
|
||||
{
|
||||
$no_html = true;
|
||||
$type[] = 'to_Text';
|
||||
}
|
||||
elseif (strpos($obj->title ? $editor_config->sel_editor_colorset : $editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
|
||||
{
|
||||
$no_html = true;
|
||||
}
|
||||
elseif ($obj->use_html === 'N')
|
||||
{
|
||||
$no_html = true;
|
||||
$type[] = 'to_Text';
|
||||
}
|
||||
|
||||
if ($no_html || $obj->use_editor === 'N' || !is_html_content($obj->content))
|
||||
if (in_array('to_Text', $type) || $obj->use_editor === 'N' || !is_html_content($obj->content))
|
||||
{
|
||||
if ($no_html)
|
||||
$type[] = 'to_HTML';
|
||||
}
|
||||
|
||||
if ($obj->markdown === 'Y')
|
||||
{
|
||||
$type[] = 'Markdown2HTML';
|
||||
}
|
||||
|
||||
// Convert
|
||||
if ($type)
|
||||
{
|
||||
if (in_array('to_Text', $type))
|
||||
{
|
||||
$obj->content = escape(strip_tags($obj->content), false);
|
||||
}
|
||||
|
||||
$obj->content = nl2br($obj->content);
|
||||
if (in_array('to_HTML', $type))
|
||||
{
|
||||
$obj->content = nl2br($obj->content);
|
||||
}
|
||||
|
||||
if (in_array('Markdown2HTML', $type))
|
||||
{
|
||||
$obj->content = Rhymix\Framework\Formatter::markdown2html($obj->content);
|
||||
}
|
||||
}
|
||||
|
||||
return $obj->content;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue