|
|
@@ -92,7 +92,7 @@ this.docUtil = this.docUtil || (() => {
|
|
|
getContentSize(content) {
|
|
|
return new Blob([content]).size;
|
|
|
},
|
|
|
- async truncateContent(content, maxSize) {
|
|
|
+ async truncateText(content, maxSize) {
|
|
|
const blob = new Blob([content]);
|
|
|
const reader = new FileReader();
|
|
|
reader.readAsText(blob.slice(0, maxSize));
|
|
|
@@ -101,7 +101,7 @@ this.docUtil = this.docUtil || (() => {
|
|
|
if (content.startsWith(reader.result)) {
|
|
|
resolve(reader.result);
|
|
|
} else {
|
|
|
- this.truncateContent(content, maxSize - 1).then(resolve).catch(reject);
|
|
|
+ this.truncateText(content, maxSize - 1).then(resolve).catch(reject);
|
|
|
}
|
|
|
}, false);
|
|
|
reader.addEventListener("error", reject, false);
|