Skip to content

Commit

Permalink
Merge pull request #345 from PlanBCode/hypha-66
Browse files Browse the repository at this point in the history
  • Loading branch information
matthijskooijman committed Oct 6, 2020
2 parents e4679f7 + 9c3cbf8 commit 0b0e373
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions system/core/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ function loadEditor($html) {
this.isFocusSet = true;
}

// listens to the paste event to strip superfluous code
wym._iframe.contentDocument.addEventListener('paste', (event) => {
event.preventDefault(); // prevent default browser behaviour (double pasting)
let pasteContent = (event.clipboardData || window.clipboardData).getData('text');
wym.paste(pasteContent);
});

// initiate the "image_upload" plugin
wym.image_upload();

Expand Down

0 comments on commit 0b0e373

Please sign in to comment.