From 578a3388c64bdad0f5aafc6aa24e985be34eab1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E5=86=9B?= Date: Fri, 29 Dec 2023 10:20:28 +0800 Subject: [PATCH] fix: import excel bug --- manifest.json | 2 +- src/ExcelView.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 1084d2a..5636d9d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "excel", "name": "Excel", - "version": "1.3.19", + "version": "1.3.20", "minAppVersion": "0.15.0", "description": "Create spreadsheets and easily embed them in Markdown", "author": "ljcoder", diff --git a/src/ExcelView.ts b/src/ExcelView.ts index 4478037..74478b1 100644 --- a/src/ExcelView.ts +++ b/src/ExcelView.ts @@ -102,6 +102,12 @@ export class ExcelView extends TextFileView { process_wb(wb: XLSX.WorkBook) { const sheetData = stox(wb); if (sheetData) { + sheetData.forEach((sheet) => { + if (sheet.rows) { + const last = Object.keys(sheet.rows).last() || "100" + sheet.rows.len = Math.max(100, parseInt(last) + 20) + } + }) this.sheet.loadData(sheetData) this.saveData(JSON.stringify(sheetData)) } else {