Extract signatures from emails sent with Newton
This commit is contained in:
parent
45850a0cd6
commit
2b0e505121
|
@ -304,6 +304,7 @@ module Email
|
|||
[:mozilla, / class="moz-/],
|
||||
[:protonmail, / class="protonmail_/],
|
||||
[:zimbra, / data-marker="__/],
|
||||
[:newton, /(id|class)="cm_/],
|
||||
]
|
||||
|
||||
def extract_from_gmail(doc)
|
||||
|
@ -360,6 +361,12 @@ module Email
|
|||
to_markdown(doc.to_html, elided.to_html)
|
||||
end
|
||||
|
||||
def extract_from_newton(doc)
|
||||
# Removes anything that has an id or a class starting with 'cm_'
|
||||
elided = doc.css("*[id^='cm_'], *[class^='cm_']").remove
|
||||
to_markdown(doc.to_html, elided.to_html)
|
||||
end
|
||||
|
||||
def trim_reply_and_extract_elided(text)
|
||||
return [text, ""] if @opts[:skip_trimming]
|
||||
EmailReplyTrimmer.trim(text, true)
|
||||
|
|
Loading…
Reference in New Issue