Skip to content

Commit

Permalink
Fix for Apple Mail
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed May 20, 2024
1 parent e1afd53 commit 7b36105
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/lib/email_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def clean_message(body)
body = unfold_paragraphs(body) unless @from.include?('yahoo.com') # fix wrapped plain text, but yahoo messes this up
body&.gsub!(/\[image\:\ Inline\ image\ [0-9]{1,2}\]/, "(see attached image)") # remove "Inline image" text from griddler
body&.gsub!(/(?:\n\r?|\r\n?)/, "<br>") # convert line breaks
body&.gsub!(/(?:\n\n?|\n\n?)/, "<br><br>") # convert line breaks for iOS Mail
body = "<p>#{body}</p>" # basic formatting
body&.gsub!(/<(http[s]?:\/\/\S*?)>/, "(\\1)") # convert links to show up
body&.gsub!(/<br\s*\/?>$/, "")&.gsub!(/<br\s*\/?>$/, "")&.gsub!(/^$\n/, "") # remove last unnecessary line break
Expand Down

0 comments on commit 7b36105

Please sign in to comment.