Tinymce editor separates all styles, but retains bullets and tables when inserting text

I use the tinymce editor, and my requirement is to erase all styles applied to the content when pasting without losing bullets and tables. Is it possible? I tried to initialize my tinymce editor as follows:

 tinymce.init({
    plugins: "paste,textcolor",
    paste_as_text: true,
    encoding: "xml",
    mode: "exact",
    selector: "textarea.className",
    menubar: false,
    statusbar: false,
    height: 257,
    browser_spellcheck: true,
    toolbar: "forecolor backcolor,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink"
});

I use the paste plugin and set paste_as_text to true. This will undo all the styles so that I can apply the desired styles myself. However, even the cartridges and tables are also devoid, which is not very good. Any ideas from people? Thanks in advance!

+4
source share
1 answer

(https://www.tinymce.com/docs/plugins/paste/#paste_as_text) , - , , , .. , , TinyMCE. true, , HTML - .

paste_as_text true, HTML- (, , ) - HTML-, :

paste_postprocess - https://www.tinymce.com/docs/plugins/paste/#paste_postprocess

JavaScript , paste , . , , HTML , , .

paste_word_valid_elements - https://www.tinymce.com/docs/plugins/paste/#paste_word_valid_elements

, HTML , paste .

, : https://www.tinymce.com/docs/plugins/paste

+3

Source: https://habr.com/ru/post/1660898/


All Articles