Tiptap: prevents pasted HTML fragments

containing images, being uploaded to the server.
This commit is contained in:
leekelleher
2024-11-12 16:54:19 +00:00
committed by Jacob Overgaard
parent e38f6e8967
commit 5032a78bf9

View File

@@ -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;