mirror of https://github.com/zulip/zulip.git
Linebreak zephyrs.
(imported from commit c77499b17ce195e36169bcb39a5f5bdfe6a3ce51)
This commit is contained in:
parent
6cff3dc735
commit
b9b7d1b8f1
|
@ -398,6 +398,9 @@ def bulk_create_clients(client_list):
|
|||
existing_clients.add(name)
|
||||
batch_bulk_create(Client, clients_to_create)
|
||||
|
||||
def linebreak(string):
|
||||
return string.replace('\n\n', '<p/>').replace('\n', '<br/>')
|
||||
|
||||
class Message(models.Model):
|
||||
sender = models.ForeignKey(UserProfile)
|
||||
recipient = models.ForeignKey(Recipient)
|
||||
|
@ -454,7 +457,7 @@ class Message(models.Model):
|
|||
|
||||
if apply_markdown:
|
||||
# obj['content'] = bugdown.convert(self.content)
|
||||
obj['content'] = escape(self.content)
|
||||
obj['content'] = linebreak(escape(self.content))
|
||||
obj['content_type'] = 'text/html'
|
||||
else:
|
||||
obj['content'] = self.content
|
||||
|
|
Loading…
Reference in New Issue