예제 #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
파일: 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()