kindeditor过滤style
❶ 怎么给kindEditor编辑器添加引用标签
kindeditor编辑器添加引用标签需要添加plugins/bockquote/bockquote.js文件。代码如下:
KindEditor.plugin('bockquote', function(K) {
var self = this, name = 'bockquote';
self.clickToolbar(name, function() {
var lang = self.lang(name + '.'),
html = ['<div style="padding:10px 20px;">',
'<textarea class="ke-textarea" style="width:408px;height:260px;"></textarea>',
'</div>'].join(''),
dialog = self.createDialog({
name : name,
width : 450,
title : self.lang(name),
body : html,
yesBtn : {
name : self.lang('yes'),
click : function(e) {
var type = textarea.val();
html = '<blockquote>' + K.escape(type) + '</blockquote>';
self.insertHtml(html).hideDialog().focus();
}
}
}),
textarea = K('textarea', dialog.div);
textarea[0].focus();
});
});
❷ Kindeditor编辑器如何设置不过滤HTML标签或者某些指定的标签
我想很多朋友在使用Kindeditor编辑器的时候都会遇到这样一个问题,如:给A标签加上title属性过后,浏览的时候,却神奇般地发现title属性没有了。再次切换html源代码的时候,返现编辑器将title属性给删掉了。追究其根本原因主要是kindeditor设置了标签和属性的默认过滤机制。
一、如何控制kindeditor编辑器不过滤任何标签?
二、如何设置Kindeditor编辑器只保留某些标签和属性?
面对这样一个问题,我们可以通过设置其htmlTags属性来得以实现。htmlTags指定要保留的HTML标记和属性。Object的key为HTML标签名,value为HTML属性数组,开始的属性表示style属性。
定义每个标签的保留属性,记住形如这样的类型font-size'主要是表示其属于标签内的style属性内的样式。形如’src'这一类的,就表示标签的直接属性。
综上所述,通过以上两种方式即可实现kindeditor编辑器的标签和属性过滤效果。
❸ 如何过滤掉KindEditor这种编辑器里的危险标签和js代码
我装user输入的回复内容查下有不有 <script></script>标签,有就将它删除
❹ kindeditor html过滤设置怎么不起作用
应该不会,你再检查一下。
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("path", path);
request.setAttribute("basePath", basePath);
%>
<link rel="stylesheet" href="${basePath }kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="${basePath }kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="${basePath }kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="${basePath }kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="${basePath }kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
editor = K.create('#content', {
pasteType : 2,
filterMode : false,
items : [
'source', '|','undo', 'redo', '|', 'preview', 'print', 'cut', '', 'paste', 'plainpaste', 'wordpaste', '|',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image','flash', 'link','fullscreen']
});
});
</script>
alert(editor.text());
❺ kindeditor如何去掉编辑器自动添加样式问题急急急!!!!!
kindeditor添加的都是默认的,用来存储到数据库在调出来直接使用的,你应该是想拿出kindeditor里面的文字吧,用正则表达式提取出来就可以了
❻ 在PHP的CI框架中,kindeditor自动过滤尖括号,怎么办
你看看application/config/config.php 文件启用了 XSS 过滤
$config['global_xss_filtering'] = TRUE;
或者您 $this->input->post( 'c', TRUE );
都会自动过滤一些特殊内附号的。容
❼ Kindeditor编辑器如何设置不过滤HTML标签或者某些指定的标签
一、如何控复制kindeditor编辑器不过滤任何标制签?
这个控制方法其实在文章http://www.stepday.com/topic/?382 内的末尾处都是有提及到的。这里就在重复啰嗦几句。主要设置是在页面内创建kindeditor编辑器的时候,设置其filterMode属性为true/false来决定是否开启过滤机制。代码如下所示:
KindEditor.ready(function (K) {
2.editor = K.create('textarea[name="content"]', {
3.filterMode: false,//是否开启过滤模式
4.});
5.});
❽ Kindeditor编辑器如何设置不过滤HTML标签或者某些指定的标签
KindEditor.ready(function(K){
editor=K.create('textarea[name="content"]',{
filterMode:false,//是否开启过滤模内式容
});
});
❾ 为什么kindeditor编译器会过滤css
首先我们知道3.4版本以上版本默认开启了过滤模式(filterMode:true)。当filterMode为true时,编辑器专会根据htmlTags设定自动过滤属HTML代码。
可是在我们平时的使用中,为了精简内容代码和达到好特定的显示效果,经常会用一些div跟css的代码,如果不更改编辑器的设定,这些代码都会被过滤,所
以如果想保留所有HTML相关代码,请将kindeditor.js里的filterMode设置成false。如果想保留特定HTML,请将
filterMode设置成true后,配置htmlTags属性。
filterMode : true // true:开启过滤模式, false:关闭过滤模式
如果改成filterMode : false之后,编辑器里面添加的代码就都会被保留。
❿ 关于kindeditor编辑器中一键排版问题!请求高手
你去搜索quickformat.js,在里面找K.each(nodeList, function(i, subList) {
将下一行的改为var wrapper = K('<p style="font-size:14px;"></p>', doc);
这样你的一键内排版就会是容14PX字号了