android_wrote regex was incorrectly iterating characters in 'wrote', resulting in greedy regex that

matched many strings with dashes
This commit is contained in:
Ezra Pagel
2017-08-21 12:47:06 -05:00
parent a2aa345712
commit 221774c6f8
2 changed files with 14 additions and 1 deletions

View File

@@ -147,7 +147,7 @@ RE_FROM_COLON_OR_DATE_COLON = re.compile(u'(_+\r?\n)?[\s]*(:?[*]?{})[\s]?:[*]?.*
RE_ANDROID_WROTE = re.compile(u'[\s]*[-]+.*({})[ ]*[-]+'.format(
u'|'.join((
# English
'wrote'
'wrote',
))), re.I)
# Support polymail.io reply format

View File

@@ -778,3 +778,16 @@ def test_split_email():
expected_markers = "stttttsttttetesetesmmmmmmssmmmmmmsmmmmmmmm"
markers = quotations.split_emails(msg)
eq_(markers, expected_markers)
def test_feedback_below_left_unparsed():
msg_body = """Please enter your feedback below. Thank you.
------------------------------------- Enter Feedback Below -------------------------------------
The user experience was unparallelled. Please continue production. I'm sending payment to ensure
that this line is intact."""
parsed = quotations.extract_from_plain(msg_body)
eq_(msg_body, parsed.decode('utf8'))