2017-03-02 20 views
0

我正在复制任何来源(如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; 
} 

回答

相关问题