kindeditor过滤html标签问题

「已注销」 2011-09-04 06:13:02
我按照配置写了,提交保存后发现没有过滤任何标签,不知道问题出在哪里,请大家帮我看看。
PS kindeditor是最新版本
配置文件入下

<script type="text/javascript" src="/static/js/kindeditor/kindeditor.js"></script>
<script type="text/javascript" src="/static/js/kindeditor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('#id_content', {
resizeType : 2,
allowImageUpload:false,
height:'500px',
fontSizeTable:'14px',
items:[
'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
'table', 'hr', 'emoticons', 'map', 'code', 'pagebreak',
'link', 'unlink', '|', 'about'
],
htmlTags:{
table: ['border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor'],
'td,th': ['align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor'],
a : ['href'],
img : ['src', 'width', 'height', 'border', 'alt', 'title'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6,div' : ['align'],
pre : ['class'],
'hr,br,tbody,tr,strong,b,sub,sup,em,i,u,strike,span,font' : ['color']
}

});
});
</script>
...全文
675 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
javabean96 2012-06-26
  • 打赏
  • 举报
回复
写错啦,4.1版本以后默认是true
4.1版本以前的要加filterMode:true
javabean96 2012-06-26
  • 打赏
  • 举报
回复
加上filterModel:true的配置
疯羽翼 2012-02-07
  • 打赏
  • 举报
回复
id不加#号吧,试试

87,901

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧