질문과답변

quill 에디터를 삽입했는데 글 수정시 html 코드가 그대로 노출됩니다.

작성자
작성일
2021-02-09 16:35
조회
131

글 저장은 정상적으로 되는데, 글 수정 시 html 코드가 그대로 노출되버립니다.


quill 에디터를 kbaord/assets/quill 디렉토리에 삽입했고,

editor.php 파일은 다음과 같습니다.


<div id="kboard-default-editor">
<form class="kboard-form" method="post" action="<?php echo $url->getContentEditorExecute()?>" enctype="multipart/form-data" onsubmit="return kboard_editor_execute(this);">

<?php $skin->editorHeader($content, $board)?>
<?php foreach($board->fields()->getSkinFields() as $key=>$field):?>
<?php echo $board->fields()->getTemplate($field, $content, $boardBuilder)?>
<?php endforeach?>
<div class="kboard-control">
<div class="left">
<?php if($content->uid):?>
<a href="<?php echo $url->getDocumentURLWithUID($content->uid)?>" class="kboard-default-button-small"><?php echo __('Back', 'kboard')?></a>
<a href="<?php echo $url->getBoardList()?>" class="kboard-default-button-small"><?php echo __('List', 'kboard')?></a>
<?php else:?>
<a href="<?php echo $url->getBoardList()?>" class="kboard-default-button-small"><?php echo __('Back', 'kboard')?></a>
<?php endif?>
</div>
<div class="right">
<?php if($board->isWriter()):?>
<button type="submit" class="kboard-default-button-small"><?php echo __('Save', 'kboard')?></button>
<?php endif?>
</div>
</div>
<textarea name="kboard_content" id="kboard_content"><?php echo $content->content?></textarea>
</form>
</div>

<?php
wp_enqueue_script('kboard-default-script', "{$skin_path}/script.js", array(), KBOARD_VERSION, true);
?>
<link href="<?php echo $skin_path ?>/assets/quill/quill.snow.css" rel="stylesheet">
<link rel="stylesheet" href="//cdn.quilljs.com/1.3.6/quill.bubble.css">
<script src="//cdn.quilljs.com/1.3.6/quill.js"></script>
<script>
var quill = new Quill('.kboard-content', {
theme: 'snow', // 'snow', 'bubble'
});
jQuery(".kboard-form").on("submit",function(){
jQuery("#kboard_content").val( jQuery(".ql-editor").html() );
});
</script>


전체 0

/