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)
|
result = views.status.to_markdown(text)
|
||||||
self.assertEqual(result, '<p><a href="http://fish.com">hi</a> ' "is rad</p>")
|
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, *_):
|
def test_delete_status(self, mock, *_):
|
||||||
"""marks a status as deleted"""
|
"""marks a status as deleted"""
|
||||||
view = views.DeleteStatus.as_view()
|
view = views.DeleteStatus.as_view()
|
||||||
|
|
|
@ -260,6 +260,7 @@ def _wrapped(text):
|
||||||
def to_markdown(content):
|
def to_markdown(content):
|
||||||
"""catch links and convert to markdown"""
|
"""catch links and convert to markdown"""
|
||||||
content = format_links(content)
|
content = format_links(content)
|
||||||
|
content = content.replace("#", "\\#")
|
||||||
content = markdown(content)
|
content = markdown(content)
|
||||||
# sanitize resulting html
|
# sanitize resulting html
|
||||||
sanitizer = InputHtmlParser()
|
sanitizer = InputHtmlParser()
|
||||||
|
|
Loading…
Reference in a new issue