UI/Previewers/PreviewerHTML.py

changeset 3981
5cd283505cfa
parent 3979
307b09aae43b
child 3991
73731c4bf5bd
equal deleted inserted replaced
3979:307b09aae43b 3981:5cd283505cfa
469 """ <b>python-docutils</b> package.<br/>Install it with""" 469 """ <b>python-docutils</b> package.<br/>Install it with"""
470 """ your package manager, 'pip install docutils' or see""" 470 """ your package manager, 'pip install docutils' or see"""
471 """ <a href="http://pypi.python.org/pypi/docutils">""" 471 """ <a href="http://pypi.python.org/pypi/docutils">"""
472 """this page.</a></p>""") 472 """this page.</a></p>""")
473 473
474 return docutils.core.publish_string(text, writer_name='html')\ 474 # redirect sys.stderr because we are not interested in it here
475 origStderr = sys.stderr
476 sys.stderr = io.StringIO()
477 html = docutils.core.publish_string(text, writer_name='html')\
475 .decode("utf-8") 478 .decode("utf-8")
479 sys.stderr = origStderr
480 return html
476 481
477 def __convertMarkdown(self, text): 482 def __convertMarkdown(self, text):
478 """ 483 """
479 Private method to convert Markdown text into HTML. 484 Private method to convert Markdown text into HTML.
480 485

eric ide

mercurial