From 6607e3abdc60236dc746c9e37a8f5dab6f6d375b Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 10 Mar 2015 13:56:03 -0700 Subject: [PATCH] fix(quoted-text): Better handling for "Wildcard filters" email --- internal_packages/message-list/lib/email-frame.cjsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal_packages/message-list/lib/email-frame.cjsx b/internal_packages/message-list/lib/email-frame.cjsx index 7206aafaf..528fcfa2c 100644 --- a/internal_packages/message-list/lib/email-frame.cjsx +++ b/internal_packages/message-list/lib/email-frame.cjsx @@ -169,7 +169,7 @@ EmailFrame = React.createClass return email if @props.showQuotedText # Split the email into lines and remove lines that begin with > or > - lines = email.split(/(\n|
)/) + lines = email.split(/(\n|]*>)/) # Remove lines that are newlines - we'll add them back in when we join. # We had to break them out because we want to preserve
elements. @@ -182,10 +182,14 @@ EmailFrame = React.createClass ] for ii in [lines.length-1..0] by -1 for regex in regexs + # Never remove a line with a blockquote start tag, because it + # quotes multiple lines, not just the current line! + if lines[ii].match(" - lines.splice(ii,1) if lines[ii] is '
' + # Remove following line if its just a spacer-style element + lines.splice(ii,1) if lines[ii].match(']*>')?[0] is lines[ii] break # Return remaining compacted email body