Merge pull request #792 from mouse-reeve/render-html-pure-serializer

Don't use html in article names for mastodon
This commit is contained in:
Mouse Reeve 2021-03-24 11:11:18 -07:00 committed by GitHub
commit 64d8ef8b16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -1,10 +1,10 @@
{% load i18n %}
{% if rating %}
{% blocktrans with book_title=book.title display_rating=rating|floatformat:"0" review_title=name count counter=rating %}Review of <em>{{ book_title }}</em> ({{ display_rating }} star): {{ review_title }}{% plural %}Review of <em>{{ book_title }}</em> ({{ display_rating }} stars): {{ review_title }}{% endblocktrans %}
{% blocktrans with book_title=book.title display_rating=rating|floatformat:"0" review_title=name count counter=rating %}Review of "{{ book_title }}" ({{ display_rating }} star): {{ review_title }}{% plural %}Review of "{{ book_title }}" ({{ display_rating }} stars): {{ review_title }}{% endblocktrans %}
{% else %}
{% blocktrans with book_title=book.title review_title=name %}Review of <em>{{ book_title }}</em>: {{ review_title }}{% endblocktrans %}
{% blocktrans with book_title=book.title review_title=name %}Review of "{{ book_title }}": {{ review_title }}{% endblocktrans %}
{% endif %}

View file

@ -278,7 +278,7 @@ class Status(TestCase):
self.assertEqual(activity["type"], "Article")
self.assertEqual(
activity["name"],
"Review of <em>%s</em> (3 stars): Review name" % self.book.title,
'Review of "%s" (3 stars): Review name' % self.book.title,
)
self.assertEqual(activity["content"], "test content")
self.assertEqual(activity["attachment"][0].type, "Document")
@ -300,7 +300,7 @@ class Status(TestCase):
self.assertEqual(activity["id"], status.remote_id)
self.assertEqual(activity["type"], "Article")
self.assertEqual(
activity["name"], "Review of <em>%s</em>: Review name" % self.book.title
activity["name"], 'Review of "%s": Review name' % self.book.title
)
self.assertEqual(activity["content"], "test content")
self.assertEqual(activity["attachment"][0].type, "Document")