You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, pasting using a custom function calls this line
var pasteContent = (event.originalEvent || event).clipboardData.getData('text/plain');
This tries to get the plain text of the line. But if we want the HTML content, we must perform our own actions on the event object. The paste functionality could be enhanced to (optionally) try to get HTML first, then plain text second.
var contentToProcess = (event.originalEvent || event).clipboardData.getData('text/html');
if (!contentToProcess) {
contentToProcess = (event.originalEvent || event).clipboardData.getData('text/plain');
}
Currently, pasting using a custom function calls this line
This tries to get the plain text of the line. But if we want the HTML content, we must perform our own actions on the event object. The paste functionality could be enhanced to (optionally) try to get HTML first, then plain text second.
Though, you will run into issues on IE due it it only accepting
Text
as a parameter of getData. Will need to consider this article to try and get pasting HTML to work on IE https://www.lucidchart.com/techblog/2014/12/02/definitive-guide-copying-pasting-javascript/The text was updated successfully, but these errors were encountered: