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

replace selection with pasted image

This commit is contained in:
Maurits Lourens
2017-11-13 22:44:18 +01:00
parent 10ec5c1342
commit dad6a93944

View File

@@ -214,8 +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) {