From 984c036b6ee96d3ee6e27535015423ee1087c240 Mon Sep 17 00:00:00 2001 From: smitcona Date: Wed, 1 Feb 2017 18:28:19 +0000 Subject: [PATCH] Set the marker back to 'm' rather than 't' if it matches the QUOT_PATTERN. Updated test case. --- talon/quotations.py | 5 ++++- tests/text_quotations_test.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/talon/quotations.py b/talon/quotations.py index 155bf4a..2e68259 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -509,7 +509,10 @@ def _correct_splitlines_in_headers(markers, lines): if bool(re.search(RE_HEADER, lines[i])): in_header_block = True else: - m = 't' + if QUOT_PATTERN.match(lines[i]): + m = 'm' + else: + m = 't' # If the line is not a header line, set in_header_block false. if not bool(re.search(RE_HEADER, lines[i])): diff --git a/tests/text_quotations_test.py b/tests/text_quotations_test.py index c0c1294..9d7deb0 100644 --- a/tests/text_quotations_test.py +++ b/tests/text_quotations_test.py @@ -730,6 +730,6 @@ Hey! > > Subject: Test > > Hi """ - expected_markers = "stttttsttttetesttesmtmmmmsmtmm" + expected_markers = "stttttsttttetesttesmmmmmmsmmmm" markers = quotations.split_emails(msg) eq_(markers, expected_markers)