mirror of
https://github.com/marktext/marktext.git
synced 2025-05-20 19:00:27 +08:00
Bugfix: can not empty the content in source code mode #105
This commit is contained in:
parent
fb057ee825
commit
aab3c652c5
@ -424,7 +424,6 @@ class Aganippe {
|
||||
|
||||
setMarkdown (markdown, cursor, renderCursor = true) {
|
||||
// if markdown is blank, dont need to import markdown
|
||||
if (!markdown.trim()) return
|
||||
let newMarkdown = markdown
|
||||
if (cursor) {
|
||||
newMarkdown = this.contentState.addCursorToMarkdown(markdown, cursor)
|
||||
|
@ -18,12 +18,14 @@
|
||||
cursor: Object,
|
||||
theme: String
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
contentState: null,
|
||||
editor: null
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
theme: function (value, oldValue) {
|
||||
const cm = this.$refs.sourceCode.querySelector('.CodeMirror')
|
||||
@ -38,6 +40,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.$nextTick(() => {
|
||||
const { markdown = '', theme } = this
|
||||
|
Loading…
Reference in New Issue
Block a user