gnu-social/plugins/Bookmark
Brion Vibber fedfde9bbb Bookmark plugin: fixes for bad DOM element nesting in delicious import data
delicious bookmark exports use the godawful HTML bookmark file format that ancient versions of Netscape used (and has thus been the common import/export format for bookmarks since the dark ages of the web :)
This arranges bookmark entries as an HTML definition list, using a lot of implied close tags (leaving off the </dt> and </dd>).
DOMDocument->loadHTML() uses libxml2's HTML mode, which generally does ok with muddling through things but apparently is really, really bad about handling those implied close tags.

Sequences of adjacent <dt> elements (eg bookmark without a description, followed by another bookmark "<dt><dt>"), end up interpreted as nested ("<dt><dt></dt></dt>") instead of as siblings ("<dt></dt><dt></dt>").
The first round of code tried to resolve the nesting inline, but ended up a bit funky in places.
I've replaced this with a standalone run through the data to re-order the elements, based on our knowing that <dt> and <dd> cannot directly contain one another; once that's done, our main logic loop can be a bit cleaner. I'm not 100% sure it's doing nested sublists correctly, but these don't seem to show up in delicious export (and even if they do, with the way we flatten the input it shouldn't make a difference).

Also fixed a clearer edge case where some bookmarks didn't get imported when missing descriptions.
2010-12-31 12:09:54 -08:00
..
bookmark.css switch bookmark CSS classes to use dash instead of underscore 2010-12-30 16:54:01 -08:00
Bookmark.php Use UUIDs for Bookmark unique ID 2010-12-30 13:21:14 -08:00
bookmarkform.php Layout on the bookmark form 2010-12-21 12:25:23 -05:00
bookmarklet Bookmarklet for new bookmarks 2010-12-21 14:43:03 -05:00
BookmarkPlugin.php Generated an extra class on bookmark notice <li>s 2010-12-30 16:57:28 -08:00
bookmarkpopup.js Tweak the post-form return on bookmarklet if we're not in a popup that we can close 2010-12-30 16:14:41 -08:00
bookmarkpopup.php Better UI for bookmark popup 2010-12-27 12:57:03 -08:00
deliciousbackupimporter.php Bookmark plugin: fixes for bad DOM element nesting in delicious import data 2010-12-31 12:09:54 -08:00
deliciousbookmarkimporter.php Bookmark plugin: graceful error out for failure to import a delicious bookmark due to it being already bookmarked 2010-12-31 12:09:15 -08:00
importbookmarks.php Break up delicious import into a queue manager by bookmark 2010-12-21 11:09:01 -05:00
importdelicious.php phpcs importdelicious.php 2010-12-29 14:21:25 -08:00
newbookmark.php Radical differences in Bookmark storage 2010-12-24 20:34:15 -08:00
noticebyurl.php phpcs noticebyurl.php 2010-12-29 14:22:41 -08:00
showbookmark.php Use UUIDs for Bookmark unique ID 2010-12-30 13:21:14 -08:00