Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TinyMCE:复制粘贴删除html,仅用于PDF的纯文本_Tinymce - Fatal编程技术网

TinyMCE:复制粘贴删除html,仅用于PDF的纯文本

TinyMCE:复制粘贴删除html,仅用于PDF的纯文本,tinymce,Tinymce,在Tinymce中复制粘贴时尝试删除html元素。下面的代码从web浏览器中删除html,但当我从PDF文件复制粘贴文本时,它不起作用。如何从PDF文件中删除垃圾邮件 <script> tinymce.init({ plugins : 'paste', paste_as_text: true, paste_remove_styles_if_webkit: true, paste_enable_default_filters : true,

在Tinymce中复制粘贴时尝试删除html元素。下面的代码从web浏览器中删除html,但当我从PDF文件复制粘贴文本时,它不起作用。如何从PDF文件中删除垃圾邮件

<script>
    tinymce.init({
    plugins : 'paste',
    paste_as_text: true,
    paste_remove_styles_if_webkit: true,
    paste_enable_default_filters : true,
    paste_block_drop : false,
    paste_retain_style_properties : "none",
    paste_strip_class_attributes : "all",
    paste_remove_spans : true,
    cleanup_on_startup : true,
    fix_list_elements : false,
    fix_nesting : false,
    fix_table_elements : false,
    paste_use_dialog : true,
    enter code here`  paste_auto_cleanup_on_paste : true,

  paste_preprocess : function(pl, o) {
            // Content string containing the HTML from the clipboard
            var str = o.content;
            var ta = document.createElement("textarea");
            ta.innerHTML = str.replace(/</g,"&lt;").replace(/>/g,"&gt;");
            o.content = CleanWordHTML(ta.value);
 },
 paste_postprocess : function(pl, o) {
}

});
</script>

tinymce.init({
插件:“粘贴”,
粘贴为文本:true,
粘贴\u删除\u样式\u如果\u webkit:true,
粘贴\启用\默认\过滤器:true,
粘贴块拖放:false,
粘贴\保留\样式\属性:“无”,
粘贴条类属性:“全部”,
粘贴\删除\跨度:true,
启动时的清理:true,
修复列表元素:false,
修复嵌套:false,
修复表元素:false,
粘贴使用对话框:true,
在此处输入代码“粘贴上的粘贴自动清理”粘贴:true,
粘贴预处理:函数(pl,o){
//包含剪贴板中HTML的内容字符串
var-str=o.content;
var ta=document.createElement(“textarea”);
ta.innerHTML=str.replace(//g,“”);
o、 content=CleanWordHTML(ta.value);
},
粘贴后处理:函数(pl,o){
}
});

如果插入pdf内容,会插入什么内容?你能告诉我们o.content是什么吗?我使用这个pdf文件作为示例,复制粘贴标题粘贴结果是“Adobe pdf/XML体系结构-工作示例”

”看看这个SO线程: