diff --git a/shared/editor/nodes/Image.tsx b/shared/editor/nodes/Image.tsx index c2186a95c0..5b825b3b2f 100644 --- a/shared/editor/nodes/Image.tsx +++ b/shared/editor/nodes/Image.tsx @@ -215,6 +215,14 @@ export default class Image extends SimpleImage { void downloadImageNode(node); }; + // Ensure only plain text can be pasted into input when pasting from another + // rich text source. + handlePaste = (event: React.ClipboardEvent) => { + event.preventDefault(); + const text = event.clipboardData.getData("text/plain"); + window.document.execCommand("insertText", false, text); + }; + component = (props: ComponentProps) => (