mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 00:18:12 +00:00
Escape pound sign before running markdown parser.
(imported from commit 418f4f76c579b5db9ec7f30cfc92c3f815323756)
This commit is contained in:
@@ -216,7 +216,10 @@ class Message(models.Model):
|
|||||||
url = match.group('url')
|
url = match.group('url')
|
||||||
return ' [%s](%s) ' % (url, url)
|
return ' [%s](%s) ' % (url, url)
|
||||||
|
|
||||||
with_links = self.link_regex.sub(linkify, self.content)
|
# Escape the # (pound sign) to avoid markdown making them into
|
||||||
|
# (giant) headers.
|
||||||
|
content = self.content.replace("#", "#")
|
||||||
|
with_links = self.link_regex.sub(linkify, content)
|
||||||
return md_engine.convert(with_links)
|
return md_engine.convert(with_links)
|
||||||
|
|
||||||
@cache_with_key(lambda self, apply_markdown: 'message_dict:%d:%d' % (self.id, apply_markdown))
|
@cache_with_key(lambda self, apply_markdown: 'message_dict:%d:%d' % (self.id, apply_markdown))
|
||||||
|
|||||||
Reference in New Issue
Block a user