mirror of
https://github.com/marktext/marktext.git
synced 2025-05-21 03:10:29 +08:00
Bugfix: #112
This commit is contained in:
parent
aab3c652c5
commit
379ffbddbc
@ -424,6 +424,7 @@ 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)
|
||||
|
@ -218,7 +218,7 @@ const importRegister = ContentState => {
|
||||
}
|
||||
|
||||
travel(rootState, childNodes)
|
||||
return rootState.children
|
||||
return rootState.children.length ? rootState.children : [this.createBlock()]
|
||||
}
|
||||
// transform `paste's text/html data` to content state blocks.
|
||||
ContentState.prototype.html2State = function (html) {
|
||||
|
Loading…
Reference in New Issue
Block a user