diff options
author | Karthik <kskarthik@disroot.org> | 2020-09-14 22:45:03 +0200 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-09-14 22:45:03 +0200 |
commit | faba409a3260716c93259ac08debca24ece9b4d1 (patch) | |
tree | 63fe8361cbf6bb920b867f1cf70c2f8752fa330f /bin/feed | |
parent | 813b70b6a057aa76e3362ae6c19cae806c7d9fb9 (diff) |
switch to mistune markdown parser
Diffstat (limited to 'bin/feed')
-rw-r--r-- | bin/feed | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -10,9 +10,8 @@ import datetime import os import os.path import re -import subprocess as subp import sys - +import mistune URL = 'http://fsf.org.in' SECTIONS = ['news', 'article'] @@ -123,15 +122,12 @@ def time(c): 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 massage(c): |