我正在从任何来源(如 MS word、Open office writer 或任何网站)复制文本并将其粘贴到富文本编辑器中。但是在网站上粘贴之后,我们要删除除粗体、斜体和下划线之外的所有样式。下面是我尝试实现的示例代码,但在 h1、h2、h3 等情况下仍然没有。请建议如何实现它。提前致谢。
tinymce.init({
selector : "#job_description",
menubar : false,
statusbar : false,
theme : "modern",
toolbar : "bold italic underline | bullist numlist",
content_css : "resources/css/richTextEditor.css",
plugins: 'paste',
paste_auto_cleanup_on_paste : true,
paste_remove_styles: true,
paste_remove_styles_if_webkit: true,
paste_strip_class_attributes: true
});
richTextEditor.css:-
.mce-item-table {
/*overflow-x:hidden!important;*/
width: auto!important;
}
.mce-content-body span,p{
font-size: 16px!important;
text-decoration: none!important;
color: #858585!important;
font-weight: 400!important;
font-family: 'Roboto', sans-serif !important;
}