def markdown(target, image=False): fragment = _markdown_fragment(target, image) return html.tostring(fragment, encoding=unicode)[5:-6] # <div>...</div>