redactor.js Word markup -
i implemented redactor.js wysiwyg editor (comes installed statamic cms). activated cleanup feature. when check word code kept when pasting things word resulting in big pile of code waste. tought aren't in 90ies anymore.
has had problem too?
you can utilize callback function pastebeforecallback
:
function cleanwordpaste( in_word_text ) { var tmp = document.createelement("div"); tmp.innerhtml = in_word_text; var newstring = tmp.textcontent||tmp.innertext; newstring = newstring.replace(/\n\n/g, "<br />").replace(/.*<!--.*-->/g,""); ( i=0; i<10; i++ ) { if ( newstring.substr(0,6)=="<br />" ) { newstring = newstring.replace("<br />", ""); } homecoming newstring; } $('#redactor').redactor({ pastebeforecallback: function(html) { homecoming cleanwordpaste(html); } });
ms-word redactor
No comments:
Post a Comment