From c895d6b3077a446e06c607d9ae2b081bf05dbe7d Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Sat, 12 Mar 2016 17:18:21 +1100 Subject: [PATCH] Set a plain text version too on cut/copy --- source/Clipboard.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/Clipboard.js b/source/Clipboard.js index db45cbb..5cf4332 100644 --- a/source/Clipboard.js +++ b/source/Clipboard.js @@ -15,6 +15,7 @@ var onCut = function ( event ) { moveRangeBoundariesUpTree( range, body ); node.appendChild( deleteContentsOfRange( range, body ) ); clipboardData.setData( 'text/html', node.innerHTML ); + clipboard.setData( 'text/plain', node.innerText || node.textContent ); event.preventDefault(); } else { setTimeout( function () { @@ -39,6 +40,7 @@ var onCopy = function ( event ) { if ( !isEdge && clipboardData ) { node.appendChild( range.cloneContents() ); clipboardData.setData( 'text/html', node.innerHTML ); + clipboard.setData( 'text/plain', node.innerText || node.textContent ); event.preventDefault(); } };