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