Skip to content

Commit

Permalink
Merge pull request #386 from thematters/develop
Browse files Browse the repository at this point in the history
Release v0.1.24
  • Loading branch information
tx0c authored Oct 18, 2021
2 parents 2596059 + 8b38f3b commit 177db9b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/modules/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,20 @@ 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)
if (formats[CodeBlock.blotName]) {
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
Expand Down

0 comments on commit 177db9b

Please sign in to comment.