android_wrote regex was incorrectly iterating characters in 'wrote', resulting in greedy regex that
matched many strings with dashes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user