示例#1
0
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
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
 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
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
def markup(text):
    html = markdown(text, smartypants=True)
    pcf = PreCodeFinder()
    pcf.feed(html)
    return pcf.close()