summaryrefslogtreecommitdiffstats
path: root/bin/html
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-09-14 22:45:03 +0200
committerrsiddharth <s@ricketyspace.net>2020-09-14 22:45:03 +0200
commitd3d2375d4086afa4b234c04ac2ae2414b04222c7 (patch)
tree63fe8361cbf6bb920b867f1cf70c2f8752fa330f /bin/html
parent813b70b6a057aa76e3362ae6c19cae806c7d9fb9 (diff)
parentfaba409a3260716c93259ac08debca24ece9b4d1 (diff)
Merge branch 'master' into 'master'
switch to mistune markdown parser See merge request fsfi/fsfi!2
Diffstat (limited to 'bin/html')
-rw-r--r--bin/html12
1 files changed, 4 insertions, 8 deletions
diff --git a/bin/html b/bin/html
index 627cd83..e071763 100644
--- a/bin/html
+++ b/bin/html
@@ -10,9 +10,8 @@ import os
import os.path
import re
import stat as st
-import subprocess as subp
import sys
-
+import mistune
SECTIONS = ['news', 'article']
@@ -128,15 +127,12 @@ def datefmt(d):
def markdown(c):
try:
- r = subp.run(['bin/markdown'],
- input=c,
- stdout=subp.PIPE,
- check=True,
- universal_newlines=True)
+ r = mistune.markdown(c, False, parse_block_html=True, parse_inline_html=True)
+
except Exception as e:
p('Markdown failed for {}'.format(c))
- return r.stdout
+ return r
def lhref(sec, s, l):