S
S
seredaes2016-04-24 22:46:58
JavaScript
seredaes, 2016-04-24 22:46:58

How to clear text when pasted in TinyMCE?

Good evening everyone. Faced such a problem.
For example, the text is copied from VK and inserted into the TinyMCE editor
d5442b7b7b6b4770b902ea61c8bbd02d.jpg
. It is saved in the database with all quotes escaped. After, if you open this text for editing in the TinyMCE editor without removing the escaping, then the text looks like this.
e3439ffffc5140dea232e8721bed1f34.jpg
How would you avoid these extra tags when inserting? They can be varied...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
A person from Kazakhstan, 2016-04-25
@LenovoId

opens wordpad or notepad normal Windows - it does not support html tags and paste and save close - then open and paste anywhere But it does not work when copying text from PDF
P:S another proof that unique content is better

M
Maxim Anarchistov, 2017-01-13
@ozonar

https://github.com/WEACOMRU/html-formatting

U
up, 2017-01-27
@nozd

TinyMCE includes many plugins, they are not included by default. To work with formatting cleanup when pasting, you can include "paste" and write, for example, a handler before pasting:
paste_preprocess: function (pl, o) {
o.content = yourMethod(o.content);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question