]> gitweb.ps.run Git - ps-cgit/blobdiff - filters/html-converters/md2html
md2html: the default of stdin works fine
[ps-cgit] / filters / html-converters / md2html
index 138713d6f6b97f1519995bf0b2632e7fdbc8d892..67141ba67936c8e84c1638c499185991b90b32d7 100755 (executable)
@@ -1,5 +1,6 @@
-#!/bin/sh
-cat <<_EOF
+#!/usr/bin/env python
+import markdown
+print('''
 <style>
 .markdown-body {
     font-size: 14px;
@@ -277,7 +278,8 @@ cat <<_EOF
     border: none;
 }
 </style>   
-_EOF
-echo "<div class='markdown-body'>"
-markdown_py -o html5
-echo "</div>"
+''')
+print("<div class='markdown-body'>")
+# Note: you may want to run this through bleach for sanitization
+markdown.markdownFromFile(output_format="html5")
+print("</div>")