I completely agree. I had made something similar in lua and it was very fun and I found many md to html converters, but not the other way around.
HTML parsing is what made me 'pause' development on that tool.
Yes. Though pandoc handles more formats and doesn't parse HTML using regex. And it supports more features.
In general the language something is written in isn't necessarily a benefit by itself. Is there a reason why you prefer Python when there already exists another tool written in another language?
When crawling online articles such as news, blogs, etc. I want to save them in markdown files but not databases.
For instance, I can download my wordpress blogs as markdown files with requests and tomd in a single python script without configering another language environment.
You don't need a Haskell interpreter, it's shipped as a compiled CLI by most good package managers. There are also Python wrappers. Regardless, I'm very glad your tool is working, it looks cool.
You should use HTML.parser and focus on the conversion to markdown.
The way you parse HTML in the convert function is very inefficient and can easily produce incorrect results with valid HTML (e.g. <p class="some>stuff">some text</p> )
14 comments
[ 2.5 ms ] story [ 44.5 ms ] thread<p>foo</p>
In general the language something is written in isn't necessarily a benefit by itself. Is there a reason why you prefer Python when there already exists another tool written in another language?