Hey everyone! I'm on the hunt for a good markdown library to help me convert markdown into HTML. It would be awesome if the library supported tables as well. Security is a priority for me, so I'm looking for something that emits safe HTML with solid defaults. I've come across two options so far: python-markdown and markdown2, but I'm curious if there's anything better out there. I also saw a discussion on this topic but didn't find many helpful responses. Any recommendations? Thanks in advance!
5 Answers
By the way, make sure to consider the documentation and community support for any library you choose—those can make a huge difference!
Have you tried markdown-it-py? It's well-maintained and part of the Executable Books project. Plus, it supports various advanced Markdown features through plugins!
If you want something different, consider checking out Quarto along with the great-tables extension. It might have some features you’re looking for!
I’ve always stuck with mistune. It’s straightforward to use and does the job well! Worth checking out.
Pandoc is a great option, but I think it might be more than you need if you're specifically looking for a Python package. It's very comprehensive though!
Thanks for the suggestion! I was hoping for something strictly in Python. Pandoc looks executable but maybe I'll keep it in mind for future projects.
Thanks! This really helped. I found that it can escape HTML code embedded within the markdown by using the "js-default" option. Super helpful, I appreciate it!