From 03b0a456e77d05b556ecb220d2f3b4dee5c10e75 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 18 Mar 2017 11:37:56 +0100 Subject: [PATCH] Improved signature detection. --- lib/core_ext/string.rb | 3 ++- test/unit/aaa_string_test.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/core_ext/string.rb b/lib/core_ext/string.rb index d178875c8..7564c067c 100644 --- a/lib/core_ext/string.rb +++ b/lib/core_ext/string.rb @@ -334,7 +334,8 @@ class String '

[[:space:]]*(--|__)', '(|

|

)[[:space:]]*(Von|From|De|от|Z|Od|Ze|Fra|Van|Mistä|Από|Dal|から|Из|од|iz|Från|จาก|з|Từ):[[:space:]]*', '(
|
)[[:space:]]*
[[:space:]]*(Von|From|De|от|Z|Od|Ze|Fra|Van|Mistä|Από|Dal|から|Из|од|iz|Från|จาก|з|Từ):[[:space:]]+', - '[[:space:]]*
[[:space:]]*(On|Am)', + '[[:space:]]*
[[:space:]]*(On|Am|Le|El|Den|Dňa|W dniu|Il|Op|Dne|Dana)[[:space:]]', + '[[:space:]]*
[[:space:]]*(On|Am|Le|El|Den|Dňa|W dniu|Il|Op|Dne|Dana)[[:space:]].+?
' assert_equal(result, html.html2html_strict) + html = '
+
Am 17.03.2017 um 17:03 schrieb Martin Edenhofer via Zammad Helpdesk <support@example.com>:
+
+
' + result = '
+
Am 17.03.2017 um 17:03 schrieb Martin Edenhofer via Zammad Helpdesk <support@example.com>:
+
+
' + assert_equal(result, html.html2html_strict) + + html = '
+
Am 17.03.2017 um 17:03 schrieb Martin Edenhofer via Zammad Helpdesk <support@example.com>:
+
+
+ +
+
Dear Mr. Smith,
+
' + result = '
+
Am 17.03.2017 um 17:03 schrieb Martin Edenhofer via Zammad Helpdesk <support@example.com>:
+
+
+
Dear Mr. Smith,
+
+
' + assert_equal(result, html.html2html_strict) end end