Skip to content

Commit

Permalink
Trigger BeforePaste on PlainText
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanValverdeU committed Dec 11, 2024
1 parent ffc58bf commit b041764
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,5 @@ export function generatePasteOptionFromPlugins(
containsBlockElements: !!htmlFromClipboard.containsBlockElements,
};

return pasteType == 'asPlainText'
? event
: editor.triggerEvent('beforePaste', event, true /* broadcast */);
return editor.triggerEvent('beforePaste', event, true /* broadcast */);
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,6 @@ describe('generatePasteOptionFromPlugins', () => {
htmlAttributes: mockedMetadata,
containsBlockElements: false,
});
expect(triggerPluginEventSpy).toHaveBeenCalledTimes(0);
expect(triggerPluginEventSpy).toHaveBeenCalledTimes(1);
});
});

0 comments on commit b041764

Please sign in to comment.