mirror of
https://github.com/marktext/marktext.git
synced 2025-05-22 03:40:27 +08:00
Bugfix: #112
This commit is contained in:
parent
aab3c652c5
commit
379ffbddbc
@ -424,6 +424,7 @@ class Aganippe {
|
|||||||
|
|
||||||
setMarkdown (markdown, cursor, renderCursor = true) {
|
setMarkdown (markdown, cursor, renderCursor = true) {
|
||||||
// if markdown is blank, dont need to import markdown
|
// if markdown is blank, dont need to import markdown
|
||||||
|
// if (!markdown.trim()) return
|
||||||
let newMarkdown = markdown
|
let newMarkdown = markdown
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
newMarkdown = this.contentState.addCursorToMarkdown(markdown, cursor)
|
newMarkdown = this.contentState.addCursorToMarkdown(markdown, cursor)
|
||||||
|
@ -218,7 +218,7 @@ const importRegister = ContentState => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
travel(rootState, childNodes)
|
travel(rootState, childNodes)
|
||||||
return rootState.children
|
return rootState.children.length ? rootState.children : [this.createBlock()]
|
||||||
}
|
}
|
||||||
// transform `paste's text/html data` to content state blocks.
|
// transform `paste's text/html data` to content state blocks.
|
||||||
ContentState.prototype.html2State = function (html) {
|
ContentState.prototype.html2State = function (html) {
|
||||||
|
Loading…
Reference in New Issue
Block a user