Example #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
Example #2
0
def benchmark_cMarkdown(text):
    import cMarkdown
    cMarkdown.markdown(text)
Example #3
0
def benchmark_cMarkdown(text):
    import cMarkdown
    cMarkdown.markdown(text)
Example #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)
Example #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)
Example #6
0
def benchmark_cmarkdown(text, loops):
    for i in loops:
        cMarkdown.markdown(text)
Example #7
0
def markup(text):
    html = markdown(text,  smartypants=True)
    pcf = PreCodeFinder()
    pcf.feed(html)
    return pcf.close()
Example #8
0
def benchmark_cmarkdown(text):
    cMarkdown.markdown(text)
Example #9
0
def markup(text):
    html = markdown(text, smartypants=True)
    pcf = PreCodeFinder()
    pcf.feed(html)
    return pcf.close()