diff --git a/common/js/common.js b/common/js/common.js index ed0cc7b78..7198d0370 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -326,6 +326,14 @@ jQuery(function($) { } }; + /** + * @brief string prototype으로 unescape 함수 추가 + **/ + String.prototype.unescape = function() { + var map = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; + return String(this).replace(/&(amp|lt|gt|quot|#039);/g, function(m) { return map[m]; }); + }; + /** * @brief string prototype으로 trim 함수 추가 **/ diff --git a/modules/editor/styles/ckeditor_light/editor.css b/modules/editor/styles/ckeditor_light/editor.css index 6a901fcb5..24ed5f64a 100644 --- a/modules/editor/styles/ckeditor_light/editor.css +++ b/modules/editor/styles/ckeditor_light/editor.css @@ -16,7 +16,7 @@ .xe_content.editable blockquote.q6{border:1px dashed #707070} .xe_content.editable blockquote.q7{border:1px dashed #707070;background:#fbfbfb} .xe_content.editable table .xe_selected_cell{background-color:#d6e9ff} - +.xe_content.editable img.cke_iframe{background-color:#444} .xe_content.editable blockquote { padding: 2px 0; diff --git a/modules/editor/tpl/js/editor.app.js b/modules/editor/tpl/js/editor.app.js index 15baab9ce..88356fbe3 100644 --- a/modules/editor/tpl/js/editor.app.js +++ b/modules/editor/tpl/js/editor.app.js @@ -143,6 +143,14 @@ function getAutoSavedSrl(ret_obj, response_tags, c) { if(!opts.enableToolbar) instance.config.toolbar = []; }); + instance.on('paste', function(e) { + if (e.data && e.data.dataValue && e.data.dataValue.replace) { + e.data.dataValue = e.data.dataValue.replace(/<(iframe|object)\s[^<>]+<\/\1>/g, function(m) { + return String(m).unescape() + '

 

'; + }); + } + }); + $containerEl.data('cke_instance', instance); window.editorRelKeys[data.editorSequence] = {};