Improved signature identifier.

This commit is contained in:
Martin Edenhofer 2015-04-05 13:05:59 +02:00
parent a13217e18b
commit 5346e2c400
2 changed files with 6 additions and 1 deletions

View file

@ -352,7 +352,7 @@ class App.Utils
# gmail
# <div class="ecxgmail_quote">
if !markers || !markers[0]
regex = new RegExp( "(<blockquote class=\"ecxgmail_quote\">)" )
regex = new RegExp( "(<blockquote class=\"(ecxgmail_quote|gmail_quote)\">)" )
if message.match( regex )
return message.replace( regex, "#{markerTemplate}\$1" )

View file

@ -653,6 +653,11 @@ test( "identify signature", function() {
result = App.Utils.signatureIdentify( message, true )
equal( result, should )
message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><blockquote class=\"gmail_quote\">lalala</blockquote></div>"
should = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class=\"js-signatureMarker\"></span><blockquote class=\"gmail_quote\">lalala</blockquote></div>"
result = App.Utils.signatureIdentify( message, true )
equal( result, should )
message = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/>Am 24. Dezember 2015 um 07:45 schrieb kathrine &lt;kathrine@example.com&gt;:<br/>lalala</div>"
should = "<div>test 123 <br/><br/>--no not match--<br/><br/>Bob Smith<br/><span class=\"js-signatureMarker\"></span>Am 24. Dezember 2015 um 07:45 schrieb kathrine &lt;kathrine@example.com&gt;:<br/>lalala</div>"
result = App.Utils.signatureIdentify( message, true )