I have a contentEditable
and I strip the formatting of pasted content on(\'paste\')
by catching the event. Then I focus a textarea, paste the content i
Upon request from Jonathan Hobbs I am posting this as the answer. Thanks to the answers above I modified my code and solved the issue. I basically copied the value of textarea into a div and grabbed only its .text():
// on paste, strip clipboard from HTML tags if any
$('#post_title, #post_content').on("paste", function() {
setTimeout(function(){
var text = $('').html($("#area").val()).text();
pasteHtmlAtCaret(text);
}, 20);
});