コード例 #1
0
ファイル: markup.py プロジェクト: karpitsky/motor-blog
def markup(text):
    if not text:
        return ''

    # cMarkdown seems to enjoy utf-8 rather than unicode
    html = markdown(text.encode('utf-8')).decode('utf-8')
    html = pygmentize(html)
    html = center_images(html)
    html = xmlcharrefreplace(html)

    return html
コード例 #2
0
def benchmark_cMarkdown(text):
    import cMarkdown
    cMarkdown.markdown(text)
コード例 #3
0
ファイル: bench.py プロジェクト: FashtimeDotCom/mistune
def benchmark_cMarkdown(text):
    import cMarkdown
    cMarkdown.markdown(text)
コード例 #4
0
 def testcase(self):
     expected_html = open(textfile.replace('.text', '.html')).read().strip()
     actual_html = cMarkdown.markdown(open(textfile).read()).strip()
     self.assertEqual(expected_html, actual_html)
コード例 #5
0
ファイル: test.py プロジェクト: paulsmith/cMarkdown
 def testcase(self):
     expected_html = open(textfile.replace('.text', '.html')).read().strip()
     actual_html = cMarkdown.markdown(open(textfile).read()).strip()
     self.assertEqual(expected_html, actual_html)
コード例 #6
0
ファイル: benchmark.py プロジェクト: honza/misaka
def benchmark_cmarkdown(text, loops):
    for i in loops:
        cMarkdown.markdown(text)
コード例 #7
0
ファイル: markup.py プロジェクト: changhu2013/plog
def markup(text):
    html = markdown(text,  smartypants=True)
    pcf = PreCodeFinder()
    pcf.feed(html)
    return pcf.close()
コード例 #8
0
ファイル: benchmark.py プロジェクト: vmg/misaka
def benchmark_cmarkdown(text):
    cMarkdown.markdown(text)
コード例 #9
0
ファイル: markup.py プロジェクト: crazymouse0/plog
def markup(text):
    html = markdown(text, smartypants=True)
    pcf = PreCodeFinder()
    pcf.feed(html)
    return pcf.close()