forked from mirrors/bookwyrm
Don't erase hashtag symbol in markdown processing
This commit is contained in:
parent
6d5923bb8f
commit
8605f5ac6b
2 changed files with 7 additions and 0 deletions
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue