Merge pull request #78 from defkev/master

Added Zimbra HTML quotation extraction
This commit is contained in:
Sergey Obukhov
2016-02-29 14:14:09 -08:00
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