X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/45e0ac7684ad3e7992531506c5136e339c95cee4..bdc72aa08e45f6ae73c31b502321fcb157a280f7:/.mutt/markdown2html 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: