[PR #2300] [MERGED] fix: handle empty folder names in HTML bookmark imports #2055

Closed
opened 2026-03-02 12:00:22 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karakeep-app/karakeep/pull/2300
Author: @MohamedBassem
Created: 12/24/2025
Status: Merged
Merged: 12/24/2025
Merged by: @MohamedBassem

Base: mainHead: claude/issue-2299-20251223-1711


📝 Commits (1)

  • 5a26c66 fix: handle empty folder names in HTML bookmark imports

📊 Changes

2 files changed (+85 additions, -1 deletions)

View changed files

📝 packages/shared/import-export/importer.test.ts (+82 -0)
📝 packages/shared/import-export/parsers.ts (+3 -1)

📄 Description

Fixes #2299

This PR fixes a bug where importing bookmarks from an HTML file would fail if the file contained folders with empty names.

Changes

  • Modified the HTML bookmark parser to trim folder names and replace empty ones with "Unnamed"
  • Added test case to verify the fix works correctly

Testing

The new test case verifies that:

  1. Empty H3 tags in bookmark HTML files are handled gracefully
  2. Folders with empty names are automatically renamed to "Unnamed"
  3. Bookmarks are correctly placed in the folder hierarchy

Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karakeep-app/karakeep/pull/2300 **Author:** [@MohamedBassem](https://github.com/MohamedBassem) **Created:** 12/24/2025 **Status:** ✅ Merged **Merged:** 12/24/2025 **Merged by:** [@MohamedBassem](https://github.com/MohamedBassem) **Base:** `main` ← **Head:** `claude/issue-2299-20251223-1711` --- ### 📝 Commits (1) - [`5a26c66`](https://github.com/karakeep-app/karakeep/commit/5a26c664f0fac47ff9b11375213bd694bd2bd1ea) fix: handle empty folder names in HTML bookmark imports ### 📊 Changes **2 files changed** (+85 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/shared/import-export/importer.test.ts` (+82 -0) 📝 `packages/shared/import-export/parsers.ts` (+3 -1) </details> ### 📄 Description Fixes #2299 This PR fixes a bug where importing bookmarks from an HTML file would fail if the file contained folders with empty names. ## Changes - Modified the HTML bookmark parser to trim folder names and replace empty ones with "Unnamed" - Added test case to verify the fix works correctly ## Testing The new test case verifies that: 1. Empty H3 tags in bookmark HTML files are handled gracefully 2. Folders with empty names are automatically renamed to "Unnamed" 3. Bookmarks are correctly placed in the folder hierarchy Generated with [Claude Code](https://claude.ai/code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 12:00:22 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#2055
No description provided.