Skip to content

Commit

Permalink
Create function to test yahoo quote present (#8640)
Browse files Browse the repository at this point in the history
* Create function for yahoo quote present

* Set return values in function

* Fix return

* refactor

* Add missing end

* Fix typo
  • Loading branch information
kimcheung authored Oct 21, 2020
1 parent 1817bec commit 828321c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,12 @@ def self.get_domain(email)
email[/(?<=@)[^.]+(?=\.)/, 0]
end

def self.yahoo_quote_present?(mail_doc)
mail_doc.css(".yahoo_quoted").any?
end

def self.yahoo_parsed_mail(mail_doc)
if mail_doc.css(".yahoo_quoted")
if yahoo_quote_present?(mail_doc)
extra_content = mail_doc.css(".yahoo_quoted")[0]
mail_doc.css(".yahoo_quoted")[0].remove
comment_content = mail_doc
Expand Down

0 comments on commit 828321c

Please sign in to comment.