Add markdown as dependency to allow casting intent's content to clean
html
This commit is contained in:
parent
1e6b35bec5
commit
d4979a2a57
|
@ -1,4 +1,6 @@
|
|||
from django.db import models
|
||||
from django.utils.html import mark_safe
|
||||
from markdown import markdown
|
||||
|
||||
|
||||
class Section(models.Model):
|
||||
|
@ -40,6 +42,9 @@ class Intent(models.Model):
|
|||
return self.content[0:50] + '...'
|
||||
return None
|
||||
|
||||
def get_message_as_markdown(self):
|
||||
return mark_safe(markdown(self.content, safe_mode='escape'))
|
||||
|
||||
|
||||
class Standard(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
|
|
|
@ -4,3 +4,4 @@ django-filter==1.0.4
|
|||
django-simple-history==1.9.0
|
||||
django-simple-history==1.9.0
|
||||
pylint
|
||||
markdown
|
||||
|
|
Loading…
Reference in New Issue