1
0
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:
Ian Storm Taylor
2016-08-09 12:45:46 -07:00
parent c4d0560bb0
commit 5d89fab5e9

View File

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