1
0

fix: 优化思源笔记转换脚本,只获取表格中指定的字段

This commit is contained in:
2025-10-12 18:39:25 +08:00
parent a563263b8d
commit 57379b540e

View File

@@ -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];
if (typeof obj[key] !== 'undefined') {
obj[key] = text ? text.trim() : '';
}
});
return obj;