From d7764d3d5c38f3697b1fb6252653982329d13310 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 14 Sep 2021 10:27:34 +1200 Subject: [PATCH] simplify PANDOC bug 7398 handling Especially with syntax highlighting, the previous way to pass the placeholder through pandoc was too brittle. No need to be fancy. Signed-off-by: martin f. krafft --- .config/mutt/markdown2html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.config/mutt/markdown2html b/.config/mutt/markdown2html index 309c22e..e1ce9af 100755 --- a/.config/mutt/markdown2html +++ b/.config/mutt/markdown2html @@ -135,8 +135,7 @@ def _preprocess_markdown(mdwn): # when used around email addresses. Note that this needs a postprocessing # hack because the pandoc autolink converted includes the ambersand # (https://github.com/jgm/pandoc/issues/7398). - ret = re.sub(r'<([^@]+@.+\.[^>]+)>', r'<\g<1> -PANDOC_BUG_7398->', ret) - + ret = re.sub(r'<([^@]+@\S+)>', r'<\g<1> PANDOC_BUG_7398 >', ret) return ret @@ -284,7 +283,7 @@ def _postprocess_html(html): # Preprocessing leaves a sentinel to work around # https://github.com/jgm/pandoc/issues/7398, and so we need to remove it: - html = html.replace(' -PANDOC_BUG_7398->', '>') + html = html.replace(' PANDOC_BUG_7398 ', '') return html -- 2.39.5