示例#1
0
    def get_text(self):
        if hasattr(self, 'body'):
            text = self.body
        elif hasattr(self, 'description'):
            text = self.description
        else:
            text = self.summary

        if self.content_format == "markdown":
            return markdown(text)
        else:
            return text
示例#2
0
    def get_text(self):
        if hasattr(self, 'body'):
            text = self.body
        elif hasattr(self, 'description'):
            text = self.description
        else:
            text = self.summary

        if self.content_format == "markdown":
            return markdown(text)
        else:
            return text
示例#3
0
文件: models.py 项目: leiyue/seed
    def get_text(self):
        if hasattr(self, 'content'):
            text = self.content
        elif hasattr(self, 'description'):
            text = self.description
        else:
            text = self.summary or ''

        if self.content_format == 'markdown':
            return markdown(text)
        else:
            return text
示例#4
0
 def get_text(self):
     if self.content_format == "markdown":
         return markdown(self.description)
     else:
         return self.description
示例#5
0
 def get_text(self):
     if self.content_format == "markdown":
         return markdown(self.description)
     else:
         return self.description
示例#6
0
 def test_markdown_function(self):
     string = u'this is a *markdown* string'
     self.assertEqual(markdown(string), Markup(u'<p>this is a '
                                               u'<em>markdown</em> '
                                               u'string</p>\n'))