mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 15:02:51 +02:00
fix data transfer with empty html strings
This commit is contained in:
@@ -128,7 +128,11 @@ class Transfer {
|
||||
getHtml() {
|
||||
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
|
||||
return html
|
||||
}
|
||||
@@ -162,7 +166,11 @@ class Transfer {
|
||||
getText() {
|
||||
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
|
||||
return text
|
||||
}
|
||||
|
Reference in New Issue
Block a user