我想在貼上tinymce編輯器時去掉所有的html標籤。以下是不是功能的代碼...以下是tinymce設置... paste_preprocess回調不會激怒...我缺少一些選項..?paste_preprocess tinymce問題
tinyMCESettings = [ {
mode : "none,textareas",
height:heightEditor,
width:'100%',
plugins: "paste",
theme : "advanced", //skin : "wp_theme",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter",
relative_urls : "true",
paste_use_dialog : false,
paste_auto_cleanup_on_paste : false,
content_css: styleSheetToLoadForTinyMCE + "?" + new Date().getTime(),
force_p_newlines: false,
setup: function (ed) {
ed.onInit.add(
function (ed, evt) {
//resizeFrame1();
var a = tinyMCE.get(ed.id).getContent();
if(a.indexOf("hcRestrictedMode", 0) > 0){
ed.getDoc().designMode = "off";
setTimeout(function(){
tinyMCE.activeEditor.dom.setAttrib(tinyMCE.activeEditor.dom.select(".hcEditable"), 'contenteditable', 'true');
}, 1000);
}
});
},
paste_preprocess : function(pl, o) {
// Content string containing the HTML from the clipboard
alert(o.content);
o.content = o.content.replace(/<.+?>/,"");
},
paste_postprocess : function(pl, o) {
// Content DOM node containing the DOM structure of the clipboard
alert(o.content)
o.content = o.content.replace(/<.+?>/,"");
}
}];
幫助這裏... 事先日Thnx ...
CleanWordHTML的任何參考實現可用? – 2014-12-27 00:46:03