Tiptap: prevents pasted HTML fragments
containing images, being uploaded to the server.
This commit is contained in:
committed by
Jacob Overgaard
parent
e38f6e8967
commit
5032a78bf9
@@ -69,6 +69,12 @@ export default class UmbTiptapMediaUploadExtensionApi extends UmbTiptapExtension
|
||||
});
|
||||
|
||||
host.addEventListener('paste', (event) => {
|
||||
const htmlContent = event.clipboardData?.getData('text/html');
|
||||
if (htmlContent) {
|
||||
// If there is HTML content, exit early to prevent uploading the remote file(s).
|
||||
return;
|
||||
}
|
||||
|
||||
const files = event.clipboardData?.files;
|
||||
if (!files) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user