Some mail clients quote an empty line as ‘>’ instead of ‘> ’. Also
check that at least one of the quoted lines is nonempty.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
import textwrap
import shlex
+quoted_re = re.compile('^(?:> ?\n)*> .+\n(?:>(?: .*)?\n)*', re.MULTILINE)
+
class ZephyrPlugin(Component):
implements(ITicketChangeListener)
p.wait()
def format_text(self, text):
- text = re.sub(re.compile('^(?:> .*\n)+', re.MULTILINE), u'> […]\n', text)
+ text = re.sub(quoted_re, u'> […]\n', text)
lines = textwrap.fill(text).split('\n')
if len(lines) > 5:
lines = lines[:5] + [u'[…]']