diff --git a/package-lock.json b/package-lock.json index ac6c694a..bd59f140 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@matters/matters-editor", - "version": "0.1.23", + "version": "0.1.24", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index eb23c72f..44ba9138 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matters/matters-editor", - "version": "0.1.23", + "version": "0.1.24", "description": "The editor component.", "author": "https://github.com/thematters", "homepage": "https://github.com/thematters/matters-editor", diff --git a/src/modules/clipboard.ts b/src/modules/clipboard.ts index 86663991..507964e1 100644 --- a/src/modules/clipboard.ts +++ b/src/modules/clipboard.ts @@ -49,7 +49,6 @@ class RemadeClipboard extends Clipboard { const formats = this.quill.getFormat(this.quill.selection.savedRange.index) const htmlRaw = event.clipboardData.getData('text/html') - const html = docsSoap(htmlRaw) // Needed for Google docs const text = event.clipboardData.getData('text/plain') let delta = new Delta().retain(range.index) @@ -57,11 +56,13 @@ class RemadeClipboard extends Clipboard { delta.insert(text, { [CodeBlock.blotName]: formats[CodeBlock.blotName], }) - } else if (!html) { + } else if (!htmlRaw) { delta.insert(text) } else { // add image matcher only pasting html this.addMatcher('IMG', createImageMatcher(this.upload)) + + const html = docsSoap(htmlRaw) // Needed for Google docs, run only when clipboard is HTML let pasteDelta = this.convert(html) // remove image matcher in case of re-upload by calling this.convert directly