コード例 #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'))
コード例 #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
コード例 #3
0
ファイル: content.py プロジェクト: Madankapoor/quokka
    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
コード例 #4
0
ファイル: channel.py プロジェクト: infrascloudy/flaskpress
 def get_text(self):
     if self.content_format == "markdown":
         return markdown(self.description)
     else:
         return self.description