A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix(web): Don't parse empty tags in netscape imports. Fixes #421
MohamedBassem4db50c234fb0
diff --git a/apps/web/lib/importBookmarkParser.ts b/apps/web/lib/importBookmarkParser.tsindex e1b21a79..1f80e5f4 100644--- a/apps/web/lib/importBookmarkParser.ts+++ b/apps/web/lib/importBookmarkParser.ts@@ -24,15 +24,17 @@ export async function parseNetscapeBookmarkFile(const $a = $(a);const addDate = $a.attr("add_date");let tags: string[] = [];++ const tagsStr = $a.attr("tags");try {- tags = $a.attr("tags")?.split(",") ?? [];+ tags = tagsStr && tagsStr.length > 0 ? tagsStr.split(",") : [];} catch (e) {/* empty */}return {title: $a.text(),url: $a.attr("href"),- tags: tags,+ tags,addDate: typeof addDate === "undefined" ? undefined : parseInt(addDate),};})@@ -60,7 +62,7 @@ export async function parsePocketBookmarkFile(return {title: $a.text(),url: $a.attr("href"),- tags: tags,+ tags,addDate: typeof addDate === "undefined" ? undefined : parseInt(addDate),};})