From e2415f652bb7704381c176db7b6c225158b858d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Sun, 21 Apr 2024 18:56:01 +0200 Subject: [PATCH] Remove leading/trailing whitespace in description --- bookmarks/templates/bookmarks/bookmark_list.html | 8 ++------ bookmarks/tests/test_bookmarks_list_template.py | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bookmarks/templates/bookmarks/bookmark_list.html b/bookmarks/templates/bookmarks/bookmark_list.html index 8478885..6e3214e 100644 --- a/bookmarks/templates/bookmarks/bookmark_list.html +++ b/bookmarks/templates/bookmarks/bookmark_list.html @@ -46,9 +46,7 @@ {% else %} {% if bookmark_item.description %} -
- {{ bookmark_item.description }} -
+
{{ bookmark_item.description }}
{% endif %} {% if bookmark_item.tag_names %}
@@ -60,9 +58,7 @@ {% endif %} {% if bookmark_item.notes %}
-
- {% markdown bookmark_item.notes %} -
+
{% markdown bookmark_item.notes %}
{% endif %}
diff --git a/bookmarks/tests/test_bookmarks_list_template.py b/bookmarks/tests/test_bookmarks_list_template.py index ab89545..6e15ee2 100644 --- a/bookmarks/tests/test_bookmarks_list_template.py +++ b/bookmarks/tests/test_bookmarks_list_template.py @@ -303,7 +303,7 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin): if has_description and has_tags: self.assertTrue("|" in description.text) - # contains description text + # contains description text, without leading/trailing whitespace if has_description: description_text = description.find("span", text=bookmark.description) self.assertIsNotNone(description_text) @@ -372,10 +372,10 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin): description = soup.select_one(".description") self.assertIsNone(description) else: - # contains description text + # contains description text, without leading/trailing whitespace description = soup.select_one(".description.separate") self.assertIsNotNone(description) - self.assertEqual(description.text.strip(), bookmark.description) + self.assertEqual(description.text, bookmark.description) if not has_tags: # no tags element