From e90ca40d33d14a23aae53b74f9b35b37637d0c01 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sat, 2 Nov 2019 23:37:42 +1300 Subject: [PATCH] pass MULTILINE as a flag, not a count --- .mutt/markdown2html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.mutt/markdown2html b/.mutt/markdown2html index 540428f..e3c2b30 100755 --- a/.mutt/markdown2html +++ b/.mutt/markdown2html @@ -98,7 +98,7 @@ def _preprocess_markdown(mdwn): # convert hard line breaks within paragraphs to 2 trailing spaces, which # is the markdown way of representing hard line breaks. Note how the # regexp will not match between paragraphs. - ret = re.sub(r'(\S)\n(\s*\S)', r'\g<1> \n\g<2>', mdwn, re.MULTILINE) + ret = re.sub(r'(\S)\n(\s*\S)', r'\g<1> \n\g<2>', mdwn, flags=re.MULTILINE) return ret @@ -153,13 +153,13 @@ def _identify_quotes_for_later(mdwn): elif prev and re.match(r'^.+:\s*$', prev) and cur.startswith('>'): ret.append(re.sub(r'^(\s*>\s*)+(.+)', r'\g<1>{.quoteinitial}\g<2>', - cur, re.MULTILINE)) + cur, flags=re.MULTILINE)) # All other occurrences of blockquotes get the "subsequent" marker: elif cur.startswith('>') and prev and not prev.startswith('>'): ret.append(re.sub(r'^((?:\s*>\s*)+)(.+)', r'\g<1>{.quotesubsequent}\g<2>', - cur, re.MULTILINE)) + cur, flags=re.MULTILINE)) else: # pass through everything else. ret.append(cur) @@ -174,7 +174,7 @@ def _reformat_quotes(html): ''' ret = html.replace('

{.quotelead}', '

') ret = re.sub(r'

\n((?:
\n)*)

(?:\{\.quote(\w+)\})', - r'

\n\g<1>

', ret, re.MULTILINE) + r'

\n\g<1>

', ret, flags=re.MULTILINE) return ret -- 2.39.2