From 57379b540ef543f9fcf72249b60892a6e3661ec9 Mon Sep 17 00:00:00 2001 From: Frost-ZX Date: Sun, 12 Oct 2025 18:39:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=80=9D=E6=BA=90?= =?UTF-8?q?=E7=AC=94=E8=AE=B0=E8=BD=AC=E6=8D=A2=E8=84=9A=E6=9C=AC=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E8=8E=B7=E5=8F=96=E8=A1=A8=E6=A0=BC=E4=B8=AD=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/convert-siyuan-notes.mjs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/convert-siyuan-notes.mjs b/scripts/convert-siyuan-notes.mjs index 43b10c4..9d402a0 100644 --- a/scripts/convert-siyuan-notes.mjs +++ b/scripts/convert-siyuan-notes.mjs @@ -44,17 +44,22 @@ function markdownTableToJson(markdownTable = '') { let jsonArray = dataRows.map(row => { let obj = { - 'created-at': '', - 'is-hide': '', - 'slug': '', 'title': '', + 'slug': '', + 'created-at': '', 'updated-at': '', + 'is-hide': '', }; headers.forEach((header, index) => { + let key = header.trim(); let text = row[index]; - obj[key] = text ? text.trim() : ''; + + if (typeof obj[key] !== 'undefined') { + obj[key] = text ? text.trim() : ''; + } + }); return obj;