Spaces:
Paused
Paused
Download helper_functions_api.py from pvanand/web-scraping: direct link, hf CLI and curl.
- Browser
- Download file 285 Bytes
-
https://huggingface.co/spaces/pvanand/web-scraping/resolve/main/helper_functions_api.py
- Command line
-
hf download hf://spaces/pvanand/web-scraping/helper_functions_api.py
-
curl -L -o helper_functions_api.py https://huggingface.co/spaces/pvanand/web-scraping/resolve/main/helper_functions_api.py
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', '') |