Spaces:
Paused
Paused
Download Powers/utils/clean_file.py from Dragdev/telegrambot: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/spaces/Dragdev/telegrambot/resolve/492d7fcd90594de1ce93896bb2a9b2f9e1927150/Powers/utils/clean_file.py
- Command line
-
hf download hf://spaces/Dragdev/telegrambot@492d7fcd90594de1ce93896bb2a9b2f9e1927150/Powers/utils/clean_file.py
-
curl -L -o clean_file.py https://huggingface.co/spaces/Dragdev/telegrambot/resolve/492d7fcd90594de1ce93896bb2a9b2f9e1927150/Powers/utils/clean_file.py
524 Bytes
| async def remove_markdown_and_html(text: str) -> str: | |
| return await clean_markdown(await clean_html(text)) | |
| async def clean_html(text: str) -> str: | |
| return ( | |
| text.replace("<code>", "") | |
| .replace("</code>", "") | |
| .replace("<b>", "") | |
| .replace("</b>", "") | |
| .replace("<i>", "") | |
| .replace("</i>", "") | |
| .replace("<u>", "") | |
| .replace("</u>", "") | |
| ) | |
| async def clean_markdown(text: str) -> str: | |
| return text.replace("`", "").replace("**", "").replace("__", "") | |