2
我有一個tinymce窗體,它的大部分工作,但是當我從互聯網或文字處理器中複製某些內容並嘗試粘貼它時,內聯樣式將與它保持一致。Tinymce粘貼包括樣式
我已經嘗試過解決這個問題了,但沒有運氣。看起來這個樣式標籤讓我感到困擾!
我只是完全刪除樣式標籤,而且我確實嘗試過,但是當我這樣做時,可以在tinymce中添加樣式,例如文本對齊......並且我並不真的想要這樣做那。
這就是我目前所看到的,你可以看到我試圖去除粘貼上的樣式,但它不起作用。一些幫助將不勝感激!
tinyMCE.init({
mode : "exact",
elements : "wStory",
plugins : "paste",
theme: "advanced",
width: "80em",
height: "700px",
paste_auto_cleanup_on_paste : true,
paste_remove_styles: true,
paste_remove_styles_if_webkit: true,
paste_strip_class_attributes: true,
theme_advanced_buttons1:"bold,italic,underline,strikethrough,hr,|,justifyleft,justifycenter,justifyright,justifyfull,outdent, indent,|,cleanup,|,forecolor, |,undo,redo,|,link, unlink",
theme_advanced_toolbar_location:"top",
theme_advanced_toolbar_align:"center",
theme_advanced_resizing:false,
width:"100%",height:"700px",
invalid_elements: "span, div",
theme_advanced_path:false,
setup : function(ed) {
ed.onInit.add(function(ed) {
ed.pasteAsPlainText = true;
});
},
});
CKeditor(TinyMCE的替代品)有一個「粘貼純色」按鈕。我認爲TinyMCE可能有類似的插件可用。最簡單的短期解決方案是將其粘貼到記事本等純文本編輯器中,然後從那裏複製。 –
我知道,但我正在爲那些不會那樣做的人建立一個網站,這就是爲什麼我要使用tinymce。我正在試圖證明我的網站白癡。他們不知道如何使用粘貼普通按鈕,我不喜歡這些粘貼的樣式標籤如何剎住我的CSS。 – zazvorniki
請參閱http://stackoverflow.com/questions/2695731/how-to-make-tinymce-paste-in-plain-text-by-default –