aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/import-export/parsers.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-12-24 12:10:02 +0200
committerGitHub <noreply@github.com>2025-12-24 10:10:02 +0000
commit3408e6e4854dc79b963eef455e9a69231de3cd28 (patch)
tree0f5c9b218bac15a1a2e90e70186b779b8946f0d9 /packages/shared/import-export/parsers.ts
parente336513fad5bd5597c890b02deb20b4519013881 (diff)
downloadkarakeep-3408e6e4854dc79b963eef455e9a69231de3cd28.tar.zst
fix: handle empty folder names in HTML bookmark imports (#2300)
When importing bookmarks from an HTML file, empty H3 tags (folder names) are now replaced with "Unnamed" to prevent import failures. Fixes #2299 Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Mohamed Bassem <MohamedBassem@users.noreply.github.com>
Diffstat (limited to 'packages/shared/import-export/parsers.ts')
-rw-r--r--packages/shared/import-export/parsers.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/shared/import-export/parsers.ts b/packages/shared/import-export/parsers.ts
index f4d3f862..5b8b01e8 100644
--- a/packages/shared/import-export/parsers.ts
+++ b/packages/shared/import-export/parsers.ts
@@ -55,7 +55,9 @@ function parseNetscapeBookmarkFile(textContent: string): ParsedBookmark[] {
while (current && current.length > 0) {
const h3 = current.find("> h3").first();
if (h3.length > 0) {
- path.unshift(h3.text());
+ const folderName = h3.text().trim();
+ // Use "Unnamed" for empty folder names
+ path.unshift(folderName || "Unnamed");
}
current = current.parent();
}