Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def markdown2rst(md):
"""Convert markdown to rst format using pandoc. No other processing."""
# import here, because outside it might not used
try:
import pandoc
except ImportError as e:
raise
else:
pandoc.PANDOC_PATH = 'pandoc' # until pyandoc gets updated
converter = pandoc.Document()
converter.gfm = md
rst = converter.rst
return rst