diff --git a/bookwyrm/tests/views/test_status.py b/bookwyrm/tests/views/test_status.py index 719b0d71..d490f484 100644 --- a/bookwyrm/tests/views/test_status.py +++ b/bookwyrm/tests/views/test_status.py @@ -217,6 +217,16 @@ class StatusViews(TestCase): 'is rad
') + def test_to_markdown_link(self): + ''' this is mostly handled in other places, but nonetheless ''' + text = '[hi](http://fish.com) is ' + result = views.status.to_markdown(text) + self.assertEqual( + result, + 'hi ' \ + 'is rad
') + + def test_handle_delete_status(self): ''' marks a status as deleted ''' view = views.DeleteStatus.as_view() diff --git a/bookwyrm/views/status.py b/bookwyrm/views/status.py index f7ed0e70..522d1f6d 100644 --- a/bookwyrm/views/status.py +++ b/bookwyrm/views/status.py @@ -48,7 +48,6 @@ class CreateStatus(View): r'%s\g<1>' % \ (mention_user.remote_id, mention_text), content) - # add reply parent to mentions and notify if status.reply_parent: status.mention_users.add(status.reply_parent.user) @@ -126,8 +125,8 @@ def format_links(content): def to_markdown(content): ''' catch links and convert to markdown ''' - content = format_links(content) content = markdown(content) + content = format_links(content) # sanitize resulting html sanitizer = InputHtmlParser() sanitizer.feed(content)