添加iframe支持(conf enable_iframe)

This commit is contained in:
gsw945
2021-10-09 18:22:43 +08:00
parent 8515abcd9d
commit b624fea255
15 changed files with 240 additions and 16 deletions

View File

@@ -54,7 +54,10 @@ $(function () {
remark: 'Remark',
}
};
var htmlDecodeList = ["style","script","title","onmouseover","onmouseout","style"];
if (!window.IS_ENABLE_IFRAME) {
htmlDecodeList.unshift("iframe");
}
window.editor = editormd("docEditor", {
width: "100%",
height: "100%",
@@ -69,8 +72,8 @@ $(function () {
fileUploadURL: window.fileUploadURL,
taskList: true,
flowChart: true,
htmlDecode: "style,script,iframe,title,onmouseover,onmouseout,style",
lineNumbers: false,
htmlDecode: htmlDecodeList.join(','),
lineNumbers: true,
sequenceDiagram: true,
tocStartLevel: 1,
tocm: true,
@@ -193,7 +196,7 @@ $(function () {
} else {
var action = window.editor.toolbarHandlers[name];
if (action !== "undefined") {
if (!!action && action !== "undefined") {
$.proxy(action, window.editor)();
window.editor.focus();
}