Skip to content

Commit

Permalink
Remove leading/trailing whitespace in description
Browse files Browse the repository at this point in the history
  • Loading branch information
sissbruecker committed Apr 21, 2024
1 parent 9cf5eb5 commit e2415f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions bookmarks/templates/bookmarks/bookmark_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
</div>
{% else %}
{% if bookmark_item.description %}
<div class="description separate">
{{ bookmark_item.description }}
</div>
<div class="description separate">{{ bookmark_item.description }}</div>
{% endif %}
{% if bookmark_item.tag_names %}
<div class="tags">
Expand All @@ -60,9 +58,7 @@
{% endif %}
{% if bookmark_item.notes %}
<div class="notes bg-gray text-gray-dark">
<div class="markdown">
{% markdown bookmark_item.notes %}
</div>
<div class="markdown">{% markdown bookmark_item.notes %}</div>
</div>
{% endif %}
<div class="actions text-gray">
Expand Down
6 changes: 3 additions & 3 deletions bookmarks/tests/test_bookmarks_list_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def inline_bookmark_description_test(self, bookmark):
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)
Expand Down Expand Up @@ -372,10 +372,10 @@ def separate_bookmark_description_test(self, bookmark):
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
Expand Down

0 comments on commit e2415f6

Please sign in to comment.