當前位置:首頁 » 凈水方式 » kindeditor過濾style

kindeditor過濾style

發布時間: 2021-01-30 22:52:58

❶ 怎麼給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字型大小了

熱點內容
丁度巴拉斯情人電影推薦 發布:2024-08-19 09:13:07 瀏覽:886
類似深水的露點電影 發布:2024-08-19 09:10:12 瀏覽:80
《消失的眼角膜》2電影 發布:2024-08-19 08:34:43 瀏覽:878
私人影院什麼電影好看 發布:2024-08-19 08:33:32 瀏覽:593
干 B 發布:2024-08-19 08:30:21 瀏覽:910
夜晚看片網站 發布:2024-08-19 08:20:59 瀏覽:440
台灣男同電影《越界》 發布:2024-08-19 08:04:35 瀏覽:290
看電影選座位追女孩 發布:2024-08-19 07:54:42 瀏覽:975
日本a級愛情 發布:2024-08-19 07:30:38 瀏覽:832
生活中的瑪麗類似電影 發布:2024-08-19 07:26:46 瀏覽:239