2017-03-02 89 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; 
} 

回答

相關問題