From: martin f. krafft Date: Tue, 10 Mar 2020 19:06:15 +0000 (+0100) Subject: md2html generate standalone emails (include images) X-Git-Url: https://git.madduck.net/etc/mutt.git/commitdiff_plain/bdc72aa08e45f6ae73c31b502321fcb157a280f7?ds=inline;hp=45e0ac7684ad3e7992531506c5136e339c95cee4 md2html generate standalone emails (include images) --- diff --git a/.mutt/markdown2html b/.mutt/markdown2html index 72d0830..4bb1a9d 100755 --- a/.mutt/markdown2html +++ b/.mutt/markdown2html @@ -214,7 +214,7 @@ def _reformat_quotes(html): def _convert_with_pandoc(mdwn, inputfmt='markdown', outputfmt='html5', ext_enabled=None, ext_disabled=None, - standalone=True, title="HTML E-Mail"): + standalone=True, selfcontained=True, title="HTML E-Mail"): ''' Invoke pandoc to do the actual conversion of Markdown to HTML5. ''' @@ -257,6 +257,8 @@ def _convert_with_pandoc(mdwn, inputfmt='markdown', outputfmt='html5', args = [] if standalone: args.append('--standalone') + if selfcontained: + args.append('--self-contained') if title: args.append(f'--metadata=pagetitle:"{title}"') @@ -294,7 +296,7 @@ def convert_markdown_to_html(mdwn): if body: body = _preprocess_markdown(body) body = _identify_quotes_for_later(body) - html = _convert_with_pandoc(body, standalone=False) + html = _convert_with_pandoc(body, standalone=True, selfcontained=True) html = _reformat_quotes(html) if sig: