From 5346e2c400dcd9e2ccd1201134b9c542e830a81a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 5 Apr 2015 13:05:59 +0200 Subject: [PATCH] Improved signature identifier. --- app/assets/javascripts/app/lib/app_post/utils.js.coffee | 2 +- public/assets/tests/html-utils.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/lib/app_post/utils.js.coffee b/app/assets/javascripts/app/lib/app_post/utils.js.coffee index d9bbef762..933e8e7d6 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.js.coffee @@ -352,7 +352,7 @@ class App.Utils # gmail #
if !markers || !markers[0] - regex = new RegExp( "(
)" ) + regex = new RegExp( "(
)" ) if message.match( regex ) return message.replace( regex, "#{markerTemplate}\$1" ) diff --git a/public/assets/tests/html-utils.js b/public/assets/tests/html-utils.js index 1ebc4391c..b0911d8cd 100644 --- a/public/assets/tests/html-utils.js +++ b/public/assets/tests/html-utils.js @@ -653,6 +653,11 @@ test( "identify signature", function() { result = App.Utils.signatureIdentify( message, true ) equal( result, should ) + message = "
test 123

--no not match--

Bob Smith
lalala
" + should = "
test 123

--no not match--

Bob Smith
lalala
" + result = App.Utils.signatureIdentify( message, true ) + equal( result, should ) + message = "
test 123

--no not match--

Bob Smith
Am 24. Dezember 2015 um 07:45 schrieb kathrine <kathrine@example.com>:
lalala
" should = "
test 123

--no not match--

Bob Smith
Am 24. Dezember 2015 um 07:45 schrieb kathrine <kathrine@example.com>:
lalala
" result = App.Utils.signatureIdentify( message, true )