X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/Scripts/git/.git/blobdiff_plain/b4a486e448c584edd2b0b12f0449d8c1d44baf05..99f25bfd883c4fabc145618937662b6abecf321d:/TracZephyrPlugin/ZephyrPlugin.py diff --git a/TracZephyrPlugin/ZephyrPlugin.py b/TracZephyrPlugin/ZephyrPlugin.py index 45584ae..679d019 100644 --- a/TracZephyrPlugin/ZephyrPlugin.py +++ b/TracZephyrPlugin/ZephyrPlugin.py @@ -7,6 +7,8 @@ import re import textwrap import shlex +quoted_re = re.compile('^(?:> ?\n)*> .+\n(?:>(?: .*)?\n)*', re.MULTILINE) + class ZephyrPlugin(Component): implements(ITicketChangeListener) @@ -26,7 +28,7 @@ class ZephyrPlugin(Component): 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'[…]']