mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +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')
|
||||
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)
|
||||
|
||||
@cache_with_key(lambda self, apply_markdown: 'message_dict:%d:%d' % (self.id, apply_markdown))
|
||||
|
||||
Reference in New Issue
Block a user