Paste Plugin

by Froala_marketing

HTML

<script src="https://raw.githack.com/eKoopmans/html2pdf/master/dist/html2pdf.bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css">
<div id="froala-editor">
  <ul><li>Copy text from MS Word<br></li><li>Open the browser console<br></li><li>Paste the text into the editor</li><li>Watch console messages <br></li></ul>
</div>

JavaScript

new FroalaEditor('div#froala-editor',{
        documentReady: true,

 //pastePlain: true,
 wordPasteModal : false,
 wordPasteKeepFormatting: true,
 wordDeniedTags: ['a'],
 wordDeniedAttrs: ['id'],
 //  pasteDeniedAttrs: ['class', 'style'],
 events: {
     'paste.beforeCleanup': function (clipboard_html) {
      // Do something here.
      // this is the editor instance.
      console.log('beforeCleanup');
      console.log(clipboard_html);
      
    },
    'paste.afterCleanup': function (clipboard_html) {
      // Do something here.
      // this is the editor instance.
      console.log('afterCleanup');
      console.log(clipboard_html);
      
    },
     'paste.before': function (original_event) {
      // Do something here.
      // this is the editor instance.
      console.log('before');
      console.log(original_event);
      
    },  
    'paste.after': function () {
      // Do something here.
      // this is the editor instance.
      console.log('after');
    }
 },
});