Don't erase hashtag symbol in markdown processing

This commit is contained in:
Mouse Reeve 2022-05-23 15:53:17 -07:00
parent 6d5923bb8f
commit 8605f5ac6b
2 changed files with 7 additions and 0 deletions

View file

@ -299,6 +299,12 @@ http://www.fish.com/"""
result = views.status.to_markdown(text)
self.assertEqual(result, '<p><a href="http://fish.com">hi</a> ' "is rad</p>")
def test_to_markdown_hashtag(self, *_):
"""hashtags not titles"""
text = "#cool"
result = views.status.to_markdown(text)
self.assertEqual(result, "<p>#cool</p>")
def test_delete_status(self, mock, *_):
"""marks a status as deleted"""
view = views.DeleteStatus.as_view()

View file

@ -260,6 +260,7 @@ def _wrapped(text):
def to_markdown(content):
"""catch links and convert to markdown"""
content = format_links(content)
content = content.replace("#", "\\#")
content = markdown(content)
# sanitize resulting html
sanitizer = InputHtmlParser()