M
M
Mikhail Pakhmutov2013-11-14 02:26:53
JavaScript
Mikhail Pakhmutov, 2013-11-14 02:26:53

Tinyeditor: prevent html pasting

I use the wysiwyg TinyEditor and had to cut a lot of features for security and content integrity. After sending, I filter everything using php without any problems, but you can insert html into the textarea itself, I would like that when pasting from the clipboard, only text is inserted, and all html tags are cut out, how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lurry, 2013-11-14
@Lurry

The decision in a forehead - to catch an insertion event and on regexp to cut out all tags. It makes sense not just to cut out closing tags, but to smartly replace them with line breaks if the element is block.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question