kindeditor html代码过滤 首发
2016-07-05 17:33
393 查看
官方
3. 为什么会丢失某些HTML标签,是不是编辑器的BUG?
这是因为3.4版本以前编辑器默认开启了过滤模式(filterMode:true)。当filterMode为true时,编辑器会根据htmlTags设定自动过滤HTML代码,主要是为了生成干净的代码。
如果想保留所有HTML,请将filterMode设置成false。如果想保留特定HTML,请将filterMode设置成true后,配置htmlTags属性。
从3.4版本开始默认关闭过滤模式,所以要过滤HTML,需要将filterMode设置成true。KE.show({
id : 'textarea_id',
filterMode : true //
true:开启过滤模式, false:关闭过滤模式
});
http://www.kindsoft.net/doc3.php?cmd=qna
http://hi.baidu.com/jwx_1170/item/d34247e3238bd6226dabb8bb
我想去掉a标签 所以直接在kindeditor-min.js 中 搜索htmlTags 把默认的标签全部删除,哈哈 成功了。
http://www.kindsoft.net/doc3.php?cmd=config
官方的默认的
htmlTags
指定要保留的HTML标记和属性。哈希数组的key为HTML标签名,value为HTML属性数组,"."开始的属性表示style属性。
数据类型:Object
默认值:{
font : ['color', 'size', 'face', '.background-color'],
span : ['style'],
div : ['class', 'align', 'style'],
table: ['class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'style'],
'td,th': ['class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor', 'style'],
a : ['class', 'href', 'target', 'name', 'style'],
embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality',
'style', 'align', 'allowscriptaccess', '/'],
img : ['src', 'width', 'height', 'border', 'alt', 'title', 'align', 'style', '/'],
hr : ['class', '/'],
br : ['/'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : ['align', 'style'],
'tbody,tr,strong,b,sub,sup,em,i,u,strike' : []
}
3. 为什么会丢失某些HTML标签,是不是编辑器的BUG?
这是因为3.4版本以前编辑器默认开启了过滤模式(filterMode:true)。当filterMode为true时,编辑器会根据htmlTags设定自动过滤HTML代码,主要是为了生成干净的代码。
如果想保留所有HTML,请将filterMode设置成false。如果想保留特定HTML,请将filterMode设置成true后,配置htmlTags属性。
从3.4版本开始默认关闭过滤模式,所以要过滤HTML,需要将filterMode设置成true。KE.show({
id : 'textarea_id',
filterMode : true //
true:开启过滤模式, false:关闭过滤模式
});
http://www.kindsoft.net/doc3.php?cmd=qna
http://hi.baidu.com/jwx_1170/item/d34247e3238bd6226dabb8bb
我想去掉a标签 所以直接在kindeditor-min.js 中 搜索htmlTags 把默认的标签全部删除,哈哈 成功了。
http://www.kindsoft.net/doc3.php?cmd=config
官方的默认的
htmlTags
指定要保留的HTML标记和属性。哈希数组的key为HTML标签名,value为HTML属性数组,"."开始的属性表示style属性。
数据类型:Object
默认值:{
font : ['color', 'size', 'face', '.background-color'],
span : ['style'],
div : ['class', 'align', 'style'],
table: ['class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'style'],
'td,th': ['class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor', 'style'],
a : ['class', 'href', 'target', 'name', 'style'],
embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality',
'style', 'align', 'allowscriptaccess', '/'],
img : ['src', 'width', 'height', 'border', 'alt', 'title', 'align', 'style', '/'],
hr : ['class', '/'],
br : ['/'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : ['align', 'style'],
'tbody,tr,strong,b,sub,sup,em,i,u,strike' : []
}
相关文章推荐
- html form表单reset
- 在编写html文件当中submit 和 button有什么区别
- 常见浏览器兼容性问题与解决方案
- HTML过滤器 - XSS Fucker 20160701
- HTML特殊符号对照表
- 在Web.xml 内配置浏览器解析html的编码格式
- HTML中的布局方式:absolute、relative、fixed、static
- 在DOM不用拼html代码变数据的技巧,ajax分页案例
- HTML第一篇
- swiper的基础使用(十五)
- swiper的基础使用(十五)
- chrome input 自动填充
- HTML <meta> charset 属性
- Sublime3 配置html
- 该怎样才能将PDF转换成HTML
- HTML-h、p、a、img标签小试
- Html中代码换行造成空格间距的问题解析
- HTML DOM
- html初学日记3
- HTML精美大转盘源码