Added Zimbra HTML quotation extraction

This commit is contained in:
defkev
2016-02-21 16:56:52 +01:00
parent c762f3c337
commit 743b452daf
2 changed files with 7 additions and 0 deletions

View File

@@ -195,3 +195,9 @@ def cut_from_block(html_message):
block.getparent().remove(block.getnext())
block.getparent().remove(block)
return True
def cut_zimbra_quote(html_message):
zDivider = html_message.xpath('//hr[@data-marker="__DIVIDER__"]')
if zDivider:
zDivider[0].getparent().remove(zDivider[0])
return True

View File

@@ -350,6 +350,7 @@ def extract_from_html(msg_body):
parser=html.HTMLParser(encoding="utf-8")
)
cut_quotations = (html_quotations.cut_gmail_quote(html_tree) or
html_quotations.cut_zimbra_quote(html_tree) or
html_quotations.cut_blockquote(html_tree) or
html_quotations.cut_microsoft_quote(html_tree) or
html_quotations.cut_by_id(html_tree) or