1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Merge pull request #1119 from mslourens/paste-image

replace selection with pasted image
This commit is contained in:
Kohei TAKATA
2017-11-15 23:57:38 +09:00
committed by GitHub

View File

@@ -214,9 +214,7 @@ export default class CodeEditor extends React.Component {
}
insertImageMd (imageMd) {
const textarea = this.editor.getInputField()
const cm = this.editor
cm.replaceSelection(`${textarea.value.substr(0, textarea.selectionStart)}${imageMd}${textarea.value.substr(textarea.selectionEnd)}`)
this.editor.replaceSelection(imageMd)
}
handlePaste (editor, e) {