]> git.za3k.com Git - blog.git/commitdiff
Add shim layer for post-processing
authorZachary Vance <za3k@za3k.com>
Wed, 17 Jul 2024 21:53:44 +0000 (17:53 -0400)
committerZachary Vance <za3k@za3k.com>
Wed, 17 Jul 2024 21:53:44 +0000 (17:53 -0400)
markdown2html.py [new file with mode: 0644]

diff --git a/markdown2html.py b/markdown2html.py
new file mode 100644 (file)
index 0000000..bf7718d
--- /dev/null
@@ -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()