TinyMCE 4 disable cleanup html

Viewed 10984

How can I disable the automatic cleaning of HTML code in TinyMCE 4.x When I copy text from WORD, TinyMCE removes styles

3 Answers
tinyMCE.init({
    // ...
    cleanup : false,
    verify_html : false
});

You will need to oppose this problem differtly because tinymce will cleanup the content no matter what.

Have a look at the tinymce config parameter paste_preprocess.

Using this param you can define a function in which you are able to modify the content to be inserted as you need to. This can be helpfull for debugging purposes too.

The other thing is you will need to define styles as valid using your valid_elements setting.

Related