Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tinyMCE Removing MS Word tags

I am using tinymce Version: 3.3.7 and when I go to paste "as plain text" from tinymce, I still get mso tags. Is it possible to have these removed by some setting in tinyMCE or do I need to strip the tags with php?

like image 929
Brian Barthold Avatar asked Sep 24 '10 19:09

Brian Barthold


2 Answers

I am not definetly sure what you want, but i guess you are trying to copy text from Word into tinymce. In order to get rid of all not wanted tags and other things like textdecoration you need to use the paste plugin. Use this settings for your init function:

plugins : "paste,...",
paste_use_dialog : false,
paste_auto_cleanup_on_paste : true,
paste_convert_headers_to_strong : false,
paste_strip_class_attributes : "all",
paste_remove_spans : true,
paste_remove_styles : true,
paste_retain_style_properties : "",

You may also use paste_preprocess and/or paste_postprocess setting to perform javascript action on the pasted code.

like image 54
Thariama Avatar answered Dec 19 '22 07:12

Thariama


source: How to make tinymce paste in plain text by default

tinyMCE.init({
    // ...
    plugins : "paste",
    paste_text_sticky : true,
    setup : function(ed) {
        ed.onInit.add(function(ed) {
            ed.pasteAsPlainText = true;
        });
    }
    // ...
});
like image 30
w35l3y Avatar answered Dec 19 '22 08:12

w35l3y