From: martin f. krafft Date: Sat, 2 Nov 2019 10:37:42 +0000 (+1300) Subject: pass MULTILINE as a flag, not a count X-Git-Url: https://git.madduck.net/etc/mutt.git/commitdiff_plain/e90ca40d33d14a23aae53b74f9b35b37637d0c01 pass MULTILINE as a flag, not a count --- 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