添加EditorMD编辑模式的base单闭合标签过滤

This commit is contained in:
yangjian 2020-12-18 20:13:21 +08:00
parent 5f2b30fa75
commit c1d71a136a
3 changed files with 3 additions and 1 deletions

View File

@ -4167,6 +4167,7 @@
var tag = filterTags[i];
html = html.replace(new RegExp("\<\s*" + tag + "\s*([^\>]*)\>([^\>]*)\<\s*\/" + tag + "\s*\>", "igm"), "");
html = html.replace(new RegExp("\<\s*" + tag + ".*?/?>", "igm"), "") // 过滤单闭合标签
}
//return html;

View File

@ -332,6 +332,7 @@
tocContainer : "#toc-container",
tocDropdown : false,
atLink : false,//禁用@链接
htmlDecode : "link,style,base,script,iframe", //过滤部分HTML标签
});
{% elif doc.editor_mode == 2 %}

View File

@ -203,7 +203,7 @@
sequenceDiagram : true, //开启序列图
imageUpload : true, //开启图片上传
codeFold :true, //代码折叠
htmlDecode : "link,style,script,iframe|on*", //解析部分HTML标签
htmlDecode : "link,style,base,script,iframe", //过滤部分HTML标签
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "{% url 'upload_doc_img' %}",
onchange:function(){