about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2015-10-12 16:42:48 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2015-10-12 16:42:54 +0200
commitccb4254104ad6faa9225ce91b9a0610f24958022 (patch)
tree88e0e6dfd8d23db874e8903ea81d5550c63c0a04
parentcache: fix resource leak: close file handle before return (diff)
downloadcgit-pink-ccb4254104ad6faa9225ce91b9a0610f24958022.tar.gz
cgit-pink-ccb4254104ad6faa9225ce91b9a0610f24958022.zip
md2html: use pure python
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rwxr-xr-xfilters/html-converters/md2html15
1 files changed, 9 insertions, 6 deletions
diff --git a/filters/html-converters/md2html b/filters/html-converters/md2html
index 138713d..1488f48 100755
--- a/filters/html-converters/md2html
+++ b/filters/html-converters/md2html
@@ -1,5 +1,7 @@
-#!/bin/sh
-cat <<_EOF
+#!/usr/bin/env python
+import markdown
+import sys
+print('''
 <style>
 .markdown-body {
     font-size: 14px;
@@ -277,7 +279,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(input=sys.stdin, output_format="html5")
+print("</div>")