Merge pull request #150 from ezrapagel/fix_greedy_dash_regex
android_wrote regex incorrectly matching
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(
|
RE_ANDROID_WROTE = re.compile(u'[\s]*[-]+.*({})[ ]*[-]+'.format(
|
||||||
u'|'.join((
|
u'|'.join((
|
||||||
# English
|
# English
|
||||||
'wrote'
|
'wrote',
|
||||||
))), re.I)
|
))), re.I)
|
||||||
|
|
||||||
# Support polymail.io reply format
|
# Support polymail.io reply format
|
||||||
|
|||||||
@@ -778,3 +778,16 @@ def test_split_email():
|
|||||||
expected_markers = "stttttsttttetesetesmmmmmmssmmmmmmsmmmmmmmm"
|
expected_markers = "stttttsttttetesetesmmmmmmssmmmmmmsmmmmmmmm"
|
||||||
markers = quotations.split_emails(msg)
|
markers = quotations.split_emails(msg)
|
||||||
eq_(markers, expected_markers)
|
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