Bookmark Editor

bkedit is a bookmark list editor. It can parse and generate .html files exported by firefox. This program depends on the library gumbo-parser, which is a HTML parser. I couldn't find time to make that into a single-file unit so you need to find it on the internet.

The program is a dual-pane editor. You must not load the same file in the two panes, otherwise you'll confuse yourself to death.

When you run it with command line arguments, the first one is the file name for the left pane and the second one (if present) is for the right pane.

A file to be loaded must have this content as a bare minimum, otherwise it crashes:

There is some configuration in $XDG_CONFIG_HOME/bkedit. In this directory, the following files are used:
The header text for saved .html files.
The footer text for saved .html files.
The program to run when the user double clicks a bookmark.
These are not strictly necessary. The program "firefox" is used if is missing.

There is an elusive memory corruption bug which I experienced only once.

I was planning to make an internal format, but I cancelled that. Just reading/writing firefox format files is sufficient. Maybe I should remove the unnecessary code.

If the input file doesn't have any DL tags in it, the program crashes. This should be handled properly.

Firefox Bookmark HTML Format

Each folder is represented by the following:
 <h3 ADD_DATE="somenumbers">title</h3>
 <dl> <p>
 ... items ...
Each item, including subfolders are within DT tags. A bookmark is recorded as:
  <a href="url" ADD_DATE="somenumbers">title</a>
The top level folder is just a DL without any H3 title.