general_chat / helper_functions_api.py
pvanand's picture
Update helper_functions_api.py
466d5bb verified
raw
history blame
285 Bytes
import mistune
from mistune.plugins.table import table
import re
def md_to_html(md_text):
renderer = mistune.HTMLRenderer()
markdown_renderer = mistune.Markdown(renderer, plugins=[table])
html_content = markdown_renderer(md_text)
return html_content.replace('\n', '')