mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-08 03:08:29 +02:00
Add support for exporting/importing bookmark notes (#532)
This commit is contained in:
@@ -18,7 +18,10 @@ class ExporterTestCase(TestCase, BookmarkFactoryMixin):
|
||||
self.setup_tag(name='tag3')]),
|
||||
self.setup_bookmark(url='https://example.com/3', title='Title 3', added=added, unread=True),
|
||||
self.setup_bookmark(url='https://example.com/4', title='Title 4', added=added, shared=True),
|
||||
|
||||
self.setup_bookmark(url='https://example.com/5', title='Title 5', added=added, shared=True,
|
||||
description='Example description', notes='Example notes'),
|
||||
self.setup_bookmark(url='https://example.com/6', title='Title 6', added=added, shared=True,
|
||||
notes='Example notes'),
|
||||
]
|
||||
html = exporter.export_netscape_html(bookmarks)
|
||||
|
||||
@@ -28,13 +31,18 @@ class ExporterTestCase(TestCase, BookmarkFactoryMixin):
|
||||
f'<DT><A HREF="https://example.com/2" ADD_DATE="{timestamp}" PRIVATE="1" TOREAD="0" TAGS="tag1,tag2,tag3">Title 2</A>',
|
||||
f'<DT><A HREF="https://example.com/3" ADD_DATE="{timestamp}" PRIVATE="1" TOREAD="1" TAGS="">Title 3</A>',
|
||||
f'<DT><A HREF="https://example.com/4" ADD_DATE="{timestamp}" PRIVATE="0" TOREAD="0" TAGS="">Title 4</A>',
|
||||
f'<DT><A HREF="https://example.com/5" ADD_DATE="{timestamp}" PRIVATE="0" TOREAD="0" TAGS="">Title 5</A>',
|
||||
'<DD>Example description[linkding-notes]Example notes[/linkding-notes]',
|
||||
f'<DT><A HREF="https://example.com/6" ADD_DATE="{timestamp}" PRIVATE="0" TOREAD="0" TAGS="">Title 6</A>',
|
||||
'<DD>[linkding-notes]Example notes[/linkding-notes]',
|
||||
]
|
||||
self.assertIn('\n\r'.join(lines), html)
|
||||
|
||||
def test_escape_html_in_title_and_description(self):
|
||||
def test_escape_html(self):
|
||||
bookmark = self.setup_bookmark(
|
||||
title='<style>: The Style Information element',
|
||||
description='The <style> HTML element contains style information for a document, or part of a document.'
|
||||
description='The <style> HTML element contains style information for a document, or part of a document.',
|
||||
notes='Interesting notes about the <style> HTML element.',
|
||||
)
|
||||
html = exporter.export_netscape_html([bookmark])
|
||||
|
||||
@@ -43,6 +51,10 @@ class ExporterTestCase(TestCase, BookmarkFactoryMixin):
|
||||
'The <style> HTML element contains style information for a document, or part of a document.',
|
||||
html
|
||||
)
|
||||
self.assertIn(
|
||||
'Interesting notes about the <style> HTML element.',
|
||||
html
|
||||
)
|
||||
|
||||
def test_handle_empty_values(self):
|
||||
bookmark = self.setup_bookmark()
|
||||
|
Reference in New Issue
Block a user