Skip to content

Commit

Permalink
(#82) 코드 하이라이트 도구 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
bi-kim committed Feb 21, 2022
1 parent 8d222b1 commit 89bea84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/EditorTools/CodeTool/CodeTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ public function initAssets()
XeFrontend::html('ckeditor.code_tool.highlight_block')->content('
<script>
window.XE.$$on(\'content.render\', function (eventName, { element }) {
var codeBlock = $(element).find(\'pre code\')
var codeBlock = $(element).find(\'pre code\');
if(codeBlock.length) {
hljs.highlightBlock(codeBlock[0]);
window.XE.$$emit(\'content.updated.codeHighlight\', codeBlock[0])
codeBlock.each(function (index, element) {
hljs.highlightBlock(element);
window.XE.$$emit(\'content.updated.codeHighlight\', element);
});
}
})
</script>
Expand Down

0 comments on commit 89bea84

Please sign in to comment.