mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 23:43:43 +00:00
Don't store the post-markdown HTML in our database content column.
(imported from commit bb81e84acc04ea0930be1026149618fbb60174fd)
This commit is contained in:
@@ -10,6 +10,11 @@ import datetime
|
||||
from zephyr.lib.cache import cache_with_key
|
||||
|
||||
from django.db.models.signals import class_prepared
|
||||
import markdown
|
||||
md_engine = markdown.Markdown(
|
||||
extensions = ['fenced_code', 'codehilite'],
|
||||
safe_mode = True,
|
||||
output_format = 'xhtml' )
|
||||
|
||||
def get_display_recipient(recipient):
|
||||
"""
|
||||
@@ -162,7 +167,7 @@ class Zephyr(models.Model):
|
||||
'display_recipient': get_display_recipient(self.recipient),
|
||||
'recipient_id' : self.recipient.id,
|
||||
'instance' : self.instance,
|
||||
'content' : self.content,
|
||||
'content' : md_engine.convert(self.content),
|
||||
'timestamp' : calendar.timegm(self.pub_date.timetuple()),
|
||||
'gravatar_hash' : hashlib.md5(settings.HASH_SALT + self.sender.user.email).hexdigest(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user