if html stripped off quotations does not have readable text fallback to unparsed html

This commit is contained in:
Sergey Obukhov
2016-08-11 19:54:53 -07:00
parent 5a9bc967f1
commit 315eaa7080
3 changed files with 56 additions and 31 deletions

View File

@@ -392,3 +392,21 @@ def test_too_large_html():
'</div>'
eq_(RE_WHITESPACE.sub('', msg_body),
RE_WHITESPACE.sub('', quotations.extract_from_html(msg_body)))
def test_readable_html_empty():
msg_body = """
<blockquote>
Reply
<div>
On 11-Apr-2011, at 6:54 PM, Bob &lt;bob@example.com&gt; wrote:
</div>
<div>
Test
</div>
</blockquote>"""
eq_(RE_WHITESPACE.sub('', msg_body),
RE_WHITESPACE.sub('', quotations.extract_from_html(msg_body)))