diff options
Diffstat (limited to 'askbot/models/answer.py')
-rw-r--r-- | askbot/models/answer.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/askbot/models/answer.py b/askbot/models/answer.py index 9f48e720..f025a0b7 100644 --- a/askbot/models/answer.py +++ b/askbot/models/answer.py @@ -9,7 +9,8 @@ from askbot.models import content from askbot.models.question import Question from askbot import const from askbot.utils.slug import slugify - +from askbot.utils import markup +from askbot.utils.html import sanitize_html class AnswerManager(models.Manager): def create_new( @@ -206,6 +207,10 @@ class AnswerRevision(ContentRevision): def get_question_title(self): return self.answer.question.title + def as_html(self): + markdowner = markup.get_parser() + return sanitize_html(markdowner.convert(self.text)) + class Meta(ContentRevision.Meta): db_table = u'answer_revision' ordering = ('-revision',) |