From: Zachary Vance Date: Wed, 17 Jul 2024 21:53:44 +0000 (-0400) Subject: Add shim layer for post-processing X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=aaf4bb4106c268ceda8208a56fbbb88aae22b8ba;p=blog.git Add shim layer for post-processing --- diff --git a/markdown2html.py b/markdown2html.py new file mode 100644 index 0000000..bf7718d --- /dev/null +++ b/markdown2html.py @@ -0,0 +1,12 @@ +import markdown2 +from bs4 import BeautifulSoup + +def post_process(soup): + pass + +def markdown2html(html): + html = markdown2.markdown(html, extras=['tables', 'header-ids', 'fenced-code-blocks']) + return html + soup = BeautifulSoup(html, 'html.parser') + soup = post_process(soup) + return soup.prettify()