mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-08 11:18:28 +02:00
Remove leading/trailing whitespace in description
This commit is contained in:
@@ -46,9 +46,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if bookmark_item.description %}
|
{% if bookmark_item.description %}
|
||||||
<div class="description separate">
|
<div class="description separate">{{ bookmark_item.description }}</div>
|
||||||
{{ bookmark_item.description }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if bookmark_item.tag_names %}
|
{% if bookmark_item.tag_names %}
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
@@ -60,9 +58,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if bookmark_item.notes %}
|
{% if bookmark_item.notes %}
|
||||||
<div class="notes bg-gray text-gray-dark">
|
<div class="notes bg-gray text-gray-dark">
|
||||||
<div class="markdown">
|
<div class="markdown">{% markdown bookmark_item.notes %}</div>
|
||||||
{% markdown bookmark_item.notes %}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="actions text-gray">
|
<div class="actions text-gray">
|
||||||
|
@@ -303,7 +303,7 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
|
|||||||
if has_description and has_tags:
|
if has_description and has_tags:
|
||||||
self.assertTrue("|" in description.text)
|
self.assertTrue("|" in description.text)
|
||||||
|
|
||||||
# contains description text
|
# contains description text, without leading/trailing whitespace
|
||||||
if has_description:
|
if has_description:
|
||||||
description_text = description.find("span", text=bookmark.description)
|
description_text = description.find("span", text=bookmark.description)
|
||||||
self.assertIsNotNone(description_text)
|
self.assertIsNotNone(description_text)
|
||||||
@@ -372,10 +372,10 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
|
|||||||
description = soup.select_one(".description")
|
description = soup.select_one(".description")
|
||||||
self.assertIsNone(description)
|
self.assertIsNone(description)
|
||||||
else:
|
else:
|
||||||
# contains description text
|
# contains description text, without leading/trailing whitespace
|
||||||
description = soup.select_one(".description.separate")
|
description = soup.select_one(".description.separate")
|
||||||
self.assertIsNotNone(description)
|
self.assertIsNotNone(description)
|
||||||
self.assertEqual(description.text.strip(), bookmark.description)
|
self.assertEqual(description.text, bookmark.description)
|
||||||
|
|
||||||
if not has_tags:
|
if not has_tags:
|
||||||
# no tags element
|
# no tags element
|
||||||
|
Reference in New Issue
Block a user