diff --git a/static/mrdoc/mrdoc.editor.js b/static/mrdoc/mrdoc.editor.js index 4ca1971b0..a4e3557bf 100644 --- a/static/mrdoc/mrdoc.editor.js +++ b/static/mrdoc/mrdoc.editor.js @@ -393,7 +393,8 @@ insertImg = function(e){ // 按钮点击插入输入框图片链接 insertImgUrl = function(){ if(editor_mode == 3){ - editor.addValue('') + img_str = DOMPurify.sanitize('',{ADD_TAGS: ['iframe']}) + editor.addValue(img_str) }else{ editor.insertValue("\n![](" + $("#img_url_input").val() + ")"); editor.focus() diff --git a/template/app_doc/editor/create_base.html b/template/app_doc/editor/create_base.html index ea476448e..e04627a9f 100644 --- a/template/app_doc/editor/create_base.html +++ b/template/app_doc/editor/create_base.html @@ -234,6 +234,7 @@ {% elif editor_mode == 3 %} + {% include 'app_doc/editor/tpl_editor_ice.html' %} {% elif editor_mode == 4 %} diff --git a/template/app_doc/editor/create_doc.html b/template/app_doc/editor/create_doc.html index 3215f7ab4..37674e5f2 100644 --- a/template/app_doc/editor/create_doc.html +++ b/template/app_doc/editor/create_doc.html @@ -272,7 +272,7 @@ var content = editor.getHTML() var pre_content = editor.getValue() }else if(editor_mode == 3){ - var content = editor.getHTML() + var content = DOMPurify.sanitize(editor.getHTML(),{ADD_TAGS: ['iframe']}) var pre_content = editor.getText() }else if(editor_mode == 4){ var content = ''; diff --git a/template/app_doc/editor/modify_doc.html b/template/app_doc/editor/modify_doc.html index adfef6308..9af8a6694 100644 --- a/template/app_doc/editor/modify_doc.html +++ b/template/app_doc/editor/modify_doc.html @@ -249,7 +249,7 @@ var content = editor.getHTML() var pre_content = editor.getValue() }else if(editor_mode == 3){ - var content = editor.getHTML() + var content = DOMPurify.sanitize(editor.getHTML(),{ADD_TAGS: ['iframe']}) var pre_content = editor.getText() }else if(editor_mode == 4){ var content = '';