This commit is contained in:
Jocs 2018-03-31 22:16:21 +08:00
parent aab3c652c5
commit 379ffbddbc
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -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) {