From 3408e6e4854dc79b963eef455e9a69231de3cd28 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Wed, 24 Dec 2025 12:10:02 +0200 Subject: 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 --- packages/shared/import-export/parsers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages/shared/import-export/parsers.ts') 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(); } -- cgit v1.2.3-70-g09d2