Open tveimo opened 2 years ago
Unfortunately the code change above isn't enough to fix this plugin (at least IMHO). There are a few more bugs that I don't think it's worth ironing out. I think the change that was made on the commit ad605a7812a97a843e7b953821f8b70e3134bb4e broke everything. Although I think the premise was good - to work on only the pasted content, things seem to go wrong when the content is inserted because it's already inserted.
The other paste plugin AllowTagsFromPate (link) is better, although it also works on the entire HTML document.
Hello, with the new plugin i've got a problem because it cleans the content before the pasted text was pasted. The solution i've found is to use setTimeout
trumbowyg.pasteHandlers.push(function () {
try {
setTimeout(function () {
trumbowyg.$ed.html(cleanIt(trumbowyg.$ed.html()));
}, 2000);
The cleanpaste plugin doesn't seem to receive any pasted text. If I move the code that fetches the pasted data to outside the setTimeout() handler, then it is able to get the data ok;