From a9d9aacd8c08f103426d959d47060fab19e323d1 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 14 Dec 2021 14:16:19 +1300 Subject: [PATCH 1/1] Prevent double-spacing in signature --- .config/mutt/markdown2html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/mutt/markdown2html b/.config/mutt/markdown2html index e1ce9af..9db5ae9 100755 --- a/.config/mutt/markdown2html +++ b/.config/mutt/markdown2html @@ -292,7 +292,7 @@ def convert_markdown_to_html(mdwn): Converts the input Markdown to HTML, handling separately the body, as well as an optional signature. ''' - parts = re.split(r'^-- $', mdwn, 1, flags=re.MULTILINE) + parts = re.split(r'^-- \n', mdwn, 1, flags=re.MULTILINE) body = parts[0] if len(parts) == 2: sig = parts[1] @@ -312,7 +312,7 @@ def convert_markdown_to_html(mdwn): sig = _preprocess_signature(sig) sig = _preprocess_markdown(sig) sig = _convert_with_pandoc(sig, standalone=False, selfcontained=False) - sig = SIGNATURE_HTML.format(sig='
'.join(sig.splitlines())) + sig = SIGNATURE_HTML.format(sig=sig) eob = html.find('') html = f'{html[:eob]}{sig}\n{html[eob:]}' -- 2.39.2