mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
replace selection with pasted image
This commit is contained in:
@@ -214,8 +214,7 @@ export default class CodeEditor extends React.Component {
|
|||||||
|
|
||||||
insertImageMd (imageMd) {
|
insertImageMd (imageMd) {
|
||||||
const textarea = this.editor.getInputField()
|
const textarea = this.editor.getInputField()
|
||||||
const cm = this.editor
|
this.editor.replaceSelection(imageMd)
|
||||||
cm.replaceSelection(`${textarea.value.substr(0, textarea.selectionStart)}${imageMd}${textarea.value.substr(textarea.selectionEnd)}`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePaste (editor, e) {
|
handlePaste (editor, e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user