Merge pull request #1844 from bookwyrm-social/review-html

Fixes review markup for mastodon serialization
This commit is contained in:
Mouse Reeve 2022-01-18 13:42:02 -08:00 committed by GitHub
commit 55ae6d1f8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -2,15 +2,15 @@
{% if rating %}
{% blocktrans trimmed with book_title=book.title|safe book_path=book.local_path display_rating=rating|floatformat:"-1" review_title=name|safe count counter=rating %}
Review of "<a href='{{ book_path }}'>{{ book_title }}</a>" ({{ display_rating }} star): {{ review_title }}
Review of "{{ book_title }}" ({{ display_rating }} star): {{ review_title }}
{% plural %}
Review of "<a href='{{ book_path }}'>{{ book_title }}</a>" ({{ display_rating }} stars): {{ review_title }}
Review of "{{ book_title }}" ({{ display_rating }} stars): {{ review_title }}
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with book_title=book.title|safe book_path=book.local_path review_title=name|safe %}
Review of "<a href='{{ book_path }}'>{{ book_title }}</a>": {{ review_title }}
Review of "{{ book_title }}": {{ review_title }}
{% endblocktrans %}
{% endif %}

View file

@ -301,7 +301,7 @@ class Status(TestCase):
self.assertEqual(activity["type"], "Article")
self.assertEqual(
activity["name"],
f"Review of \"<a href='{self.book.local_path}'>{self.book.title}</a>\" (3 stars): Review's name",
f'Review of "{self.book.title}" (3 stars): Review\'s name',
)
self.assertEqual(activity["content"], "test content")
self.assertEqual(activity["attachment"][0].type, "Document")
@ -326,7 +326,7 @@ class Status(TestCase):
self.assertEqual(activity["type"], "Article")
self.assertEqual(
activity["name"],
f"Review of \"<a href='{self.book.local_path}'>{self.book.title}</a>\": Review name",
f'Review of "{self.book.title}": Review name',
)
self.assertEqual(activity["content"], "test content")
self.assertEqual(activity["attachment"][0].type, "Document")