X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/6ebf19acd375963b83cfc7577440c17eda803548..3ce03d14acbe7390115450bae85814a6989bfece:/.mutt/markdown2html?ds=inline diff --git a/.mutt/markdown2html b/.mutt/markdown2html index 35b4ea2..e0a2b19 100755 --- a/.mutt/markdown2html +++ b/.mutt/markdown2html @@ -107,7 +107,6 @@ HTML_DOCUMENT = ''' -HTML E-Mail {htmlbody} ''' @@ -215,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=None): ''' Invoke pandoc to do the actual conversion of Markdown to HTML5. ''' @@ -258,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}"') @@ -295,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: