Esempio n. 1
0
 def test_markdown_function(self):
     string = 'this is a *markdown* string'
     self.assertEqual(
         markdown(string),
         Markup('<p>this is a '
                '<em>markdown</em> '
                'string</p>\n'))
Esempio n. 2
0
    def get_text(self):
        if hasattr(self, 'body'):
            text = self.body
        elif hasattr(self, 'description'):
            text = self.description
        else:
            text = self.summary or ""

        if self.content_format == "markdown":
            return markdown(text)
        else:
            return text
Esempio n. 3
0
    def get_text(self):
        if hasattr(self, 'body'):
            text = self.body
        elif hasattr(self, 'description'):
            text = self.description
        else:
            text = self.summary or ""

        if self.content_format == "markdown":
            return markdown(text)
        else:
            return text
Esempio n. 4
0
 def get_text(self):
     if self.content_format == "markdown":
         return markdown(self.description)
     else:
         return self.description