TinyMCE: Insert Text as Plain Text without any Formatting
Question by Guest | 2014-05-06 at 16:33
When copying some text out of a Word file or an HTML document into my TinyMCE-Editor, the text always contains many formatting such as colors, boxes or tables that should not be taken over.
Of course, it is different when I copy a unformatted text, for example out of a plain text editor.
How can I achieve that even original formatted text will be copied as plain text without any formatting into the TinyMCE-Editor?
Related Topics
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
TinyMCE Editor not shown after second call
Question | 3 Answers
TinyMCE: Check if TinyMCE is available
Question | 1 Answer
Windows Batch Script: Computer Shutdown
Tutorial | 2 Comments
TinyMCE: Do not convert Special Characters to Named Entities
Question | 1 Answer
TinyMCE: Remove TinyMCE Editor from Textarea
Question | 1 Answer
TinyMCE should use <b> and <i> instead of <strong> and <em>-tags
Question | 4 Answers
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
TinyMCE is providing a plugin called "paste" that can care about this thing. The property "paste_as_text" should be set to "true".
Here is an example of how to include the plugin:
In your case, also using "paste_word_valid_elements" instead of "paste_as_text" could be helpful. You can use it like that:
With this property, you can define some HTML tags that are allowed to be taken over from Word (or any other source). All other elements not defined here are removed automatically. So, it is possible, for example, to take over headings or bold words but not every formatting.
2014-05-06 at 17:23