mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 23:12:52 +02:00
fix data transfer with empty html strings
This commit is contained in:
@@ -128,7 +128,11 @@ class Transfer {
|
|||||||
getHtml() {
|
getHtml() {
|
||||||
if ('html' in this.cache) return this.cache.html
|
if ('html' in this.cache) return this.cache.html
|
||||||
|
|
||||||
const html = this.data.getData('text/html')
|
let html
|
||||||
|
const string = this.data.getData('text/html')
|
||||||
|
|
||||||
|
if (string != '') html = string
|
||||||
|
|
||||||
this.cache.html = html
|
this.cache.html = html
|
||||||
return html
|
return html
|
||||||
}
|
}
|
||||||
@@ -162,7 +166,11 @@ class Transfer {
|
|||||||
getText() {
|
getText() {
|
||||||
if ('text' in this.cache) return this.cache.text
|
if ('text' in this.cache) return this.cache.text
|
||||||
|
|
||||||
const text = this.data.getData('text/plain')
|
let text
|
||||||
|
const string = this.data.getData('text/plain')
|
||||||
|
|
||||||
|
if (string != '') text = string
|
||||||
|
|
||||||
this.cache.text = text
|
this.cache.text = text
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user