From 82b0b08979f63b88b93bf1419cde659cb262e2a3 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Mon, 9 Sep 2019 18:16:12 -0400
Subject: need toDOM for images or you cant paste them

---
 src/client/util/RichTextSchema.tsx | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'src/client/util/RichTextSchema.tsx')

diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx
index 05a37759f..e71031a87 100644
--- a/src/client/util/RichTextSchema.tsx
+++ b/src/client/util/RichTextSchema.tsx
@@ -144,6 +144,11 @@ export const nodes: { [index: string]: NodeSpec } = {
                 };
             }
         }],
+        // TODO if we don't define toDom, dragging the image crashes. Why?
+        toDOM(node) {
+            const attrs = { style: `width: ${node.attrs.width}` };
+            return ["img", { ...node.attrs, ...attrs }];
+        }
     },
 
     video: {
-- 
cgit v1.2.3-70-g09d2

