X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/9b91a8f29bc78e793a0a664692641a2326a4ae90..94698af38a3a5aa4d3dc3cbfe6aafb440dee8714:/.config/mutt/markdown2html diff --git a/.config/mutt/markdown2html b/.config/mutt/markdown2html index 6a45558..327dff2 100755 --- a/.config/mutt/markdown2html +++ b/.config/mutt/markdown2html @@ -257,7 +257,7 @@ def _convert_with_pandoc(mdwn, inputfmt='markdown', outputfmt='html5', disabled = '-'.join(ext_disabled) inputfmt = f'{inputfmt}+{enabled}-{disabled}' - args = [] + args = ['--metadata=document-css:false'] if standalone: args.append('--standalone') if selfcontained: @@ -328,10 +328,11 @@ def main(): Convert text on stdin to HTML, and print it to stdout, like mutt would expect. ''' - html = convert_markdown_to_html(sys.stdin.read()) - if html: - # mutt expects the content type in the first line, so: - print(f'text/html\n\n{html}') + with open(sys.argv[1], 'r') if len(sys.argv) > 1 else sys.stdin as f: + html = convert_markdown_to_html(f.read()) + if html: + # mutt expects the content type in the first line, so: + print(f'text/html\n\n{html}') if __name__ == '__main__':