2023-05-12 开启多语言插件支持……

KindEditor保留htmltag,以及关闭html过滤

kindeditor 苏 demo 2920℃ 0评论
KindEditor.ready(function (K) {
            editor = K.create('textarea[name="content"]', {
filterMode
: false,//是否开启过滤模式 }); });

 

以及JS配置文件内,不在列表内的都被过滤掉了

htmlTags
{
 font : ['color', 'size', 'face', '.background-color'],
 span : [
 '.color', '.background-color', '.font-size', '.font-family', '.background',
 '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
 ],
 div : [
 'align', '.border', '.margin', '.padding', '.text-align', '.color',
 '.background-color', '.font-size', '.font-family', '.font-weight', '.background',
 '.font-style', '.text-decoration', '.vertical-align', '.margin-left'
 ],
 table: [
 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
 '.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
 '.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
 '.width', '.height', '.border-collapse'
 ],
 'td,th': [
 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
 '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
 '.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
 ],
 a : ['href', 'target', 'name'],
 embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
 img : ['src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
 'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
 '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
 ],
 pre : ['class'],
 hr : ['class', '.page-break-after'],
 'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : []
}
打赏

转载请注明:苏demo的别样人生 » KindEditor保留htmltag,以及关闭html过滤

   如果本篇文章对您有帮助,欢迎向博主进行赞助,赞助时请写上您的用户名。
支付宝直接捐助帐号oracle_lee@qq.com 感谢支持!
喜欢 (0)or分享 (0)