]> git.immae.eu Git - github/shaarli/Shaarli.git/commit - index.php
Refactor bookmark import using a generic Netscape parser 612/head
authorVirtualTam <virtualtam@flibidi.net>
Thu, 28 Jul 2016 20:54:33 +0000 (22:54 +0200)
committerVirtualTam <virtualtam@flibidi.net>
Tue, 9 Aug 2016 23:42:44 +0000 (01:42 +0200)
commita973afeac7b7399d35b881920f0afc1947765ccd
tree4a13ddf32779cb8f02600d7cc20d23f692c9068c
parent085157c5cb6bd0df928c7875fb7997683418f1fb
Refactor bookmark import using a generic Netscape parser

Relates to #607
Relates to #608
Relates to #493 (abandoned)

Additions:
- use Composer's autoload to load 3rd-party dependencies under vendor/

Modifications:
- [import] replace the current parser with a generic, stable parser
  - move code to application/NetscapeBookmarkUtils
  - improve status report after parsing
- [router] use the same endpoint for both bookmark upload and import dialog
- [template] update bookmark import options
  - allow adding tags to all imported links
  - allow selecting the visibility (privacy) of imported links
- [tests] ensure bookmarks are properly parsed and imported in the LinkDB
  - reuse reference input from the parser's test data

See:
- https://github.com/shaarli/netscape-bookmark-parser
- https://getcomposer.org/doc/01-basic-usage.md#autoloading

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
application/NetscapeBookmarkUtils.php
index.php
tests/NetscapeBookmarkUtils/BookmarkExportTest.php [moved from tests/NetscapeBookmarkUtilsTest.php with 97% similarity]
tests/NetscapeBookmarkUtils/BookmarkImportTest.php [new file with mode: 0644]
tests/NetscapeBookmarkUtils/input/empty.htm [new file with mode: 0644]
tests/NetscapeBookmarkUtils/input/netscape_basic.htm [new file with mode: 0644]
tests/NetscapeBookmarkUtils/input/netscape_nested.htm [new file with mode: 0644]
tests/NetscapeBookmarkUtils/input/no_doctype.htm [new file with mode: 0644]
tests/NetscapeBookmarkUtils/input/same_date.htm [new file with mode: 0644]
tpl/import.html