💭 Alir3z4/html2text: Convert HTML to Markdown-formatted text.

!https://github.com/Alir3z4/html2text

GitHub - Alir3z4/html2text: Convert HTML to Markdown-formatted text.
Convert HTML to Markdown-formatted text. Contribute to Alir3z4/html2text development by creating an account on GitHub.
GitHub · github.com

Super neat tool to convert html to markdown

>>> import html2text
>>>
>>> print(html2text.html2text("<p><strong>Zed's</strong> dead baby, <em>Zed's</em> dead.</p>"))
**Zed's** dead baby, _Zed's_ dead.

It even plays nicely with rich.

from rich.markdown import Markdown
from rich.console import Console
import html2text
console = Console()
md = Markdown(html2text.html2text("<p><strong>Zed's</strong> dead baby, <em>Zed's</em> dead.</p>"))
console.print(md)

Note

This post is a thought. It’s a short note that I make about someone else’s content online #thoughts

Connections

Related tags and posts connected to this entry.