shaarli/netscape-bookmark-parser

Importing descriptions

warenhaus opened this issue · 3 comments

I had a problem importing descriptions from an old scuttle installation.

Is it possible that the regexp pattern is too specific? I had to change the pattern in line 148
https://github.com/shaarli/netscape-bookmark-parser/blob/master/NetscapeBookmarkParser.php#L148

from
/note="(.*?)"<\/a>/i
to
/note="(.*?)"/i

ie. removing the requirement for the description to be immediately followed by the closing anchor-tag. (my export had attributes like the tags and the date etc in between the description and the closing anchor.

also, the description in the scuttle export is called "description", instead of "note". so maybe the parser could check for both versions?

Hi @warenhaus!

As stated in this project's description, the Netscape bookmark format is quite loose, and each and every application vendor (Internet Explorer, Firefox, etc.) implements it its own way, making it quite tedious to provide a generic parser :)

Could you provide us with a sample export from Scuttle so we can add it as a reference test input and update parser code accordingly?

yes, thank you for replying so quickly!

attached a sample, nevermind the encoding errors for the special chars (German umlauts)

sample-scuttle.html.txt

Thanks! I'll submit a PR over the weekend to address this ;-)