diff --git a/app/assets/stylesheets/zammad.scss b/app/assets/stylesheets/zammad.scss index dfb8413f1..f04976fb1 100644 --- a/app/assets/stylesheets/zammad.scss +++ b/app/assets/stylesheets/zammad.scss @@ -4561,7 +4561,6 @@ footer { padding: 0 55px; } - .article-content-meta { position: absolute; width: 100%; @@ -4663,7 +4662,7 @@ footer { left: 0; right: 0; background: white; - + &.is-open { &:before { opacity: 0; @@ -4701,6 +4700,10 @@ footer { box-shadow: none; } + .customer .richtext-content blockquote { + border-left: 5px solid #dfdfdf; + } + .customer.ticket-article-item.state--folde-out .textBubble { border-color: hsl(199,44%,85%); } diff --git a/config/initializers/html_sanitizer.rb b/config/initializers/html_sanitizer.rb index d2815923e..f504e2acc 100644 --- a/config/initializers/html_sanitizer.rb +++ b/config/initializers/html_sanitizer.rb @@ -24,7 +24,7 @@ Rails.application.config.html_sanitizer_tags_whitelist = %w( # attributes allowed for tags Rails.application.config.html_sanitizer_attributes_whitelist = { - :all => %w(class dir lang style title translate data-signature data-signature-id), + :all => %w(class dir lang title translate data-signature data-signature-id), 'a' => %w(href hreflang name rel), 'abbr' => %w(title), 'blockquote' => %w(type cite), @@ -33,7 +33,7 @@ Rails.application.config.html_sanitizer_attributes_whitelist = { 'data' => %w(value), 'del' => %w(cite datetime), 'dfn' => %w(title), - 'img' => %w(align alt border height src srcset width), + 'img' => %w(align alt border height src srcset width style), 'ins' => %w(cite datetime), 'li' => %w(value), 'ol' => %w(reversed start type), diff --git a/lib/core_ext/string.rb b/lib/core_ext/string.rb index f309b98c3..d178875c8 100644 --- a/lib/core_ext/string.rb +++ b/lib/core_ext/string.rb @@ -301,17 +301,18 @@ class String string.gsub!(/######SIGNATURE_MARKER######/, '') return string.chomp end - - #string.gsub!(/
[[:space:]]+<\/p>
[[:space:]]+<\/p>/m, '
') - string.gsub!(%r{
[[:space:]]+
\n[[:space:]]+
}im, '') - string.gsub!(%r{
[[:space:]]*
([[:space:]]*)){2,}}im, '\2') + string.gsub!(%r\
[[:space:]]*
(
[[:space:]]*
([[:space:]]*
}im, '
') + string.gsub!(%r\(
[[:space:]]+
}im, '') + string.gsub!(%r{\A(
[[:space:]]*(--|__)',
'(
|
|
[[:space:]]*[[:space:]]*(On|Am)', ] map.each { |regexp| diff --git a/test/controllers/ticket_articles_controller_test.rb b/test/controllers/ticket_articles_controller_test.rb index cc454978d..449f6590b 100644 --- a/test/controllers/ticket_articles_controller_test.rb +++ b/test/controllers/ticket_articles_controller_test.rb @@ -109,6 +109,12 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO assert_equal(0, ticket.articles[0].attachments.count) assert_equal(0, ticket.articles[1].attachments.count) assert_equal(1, ticket.articles[2].attachments.count) + assert(ticket.articles[2].attachments[0]['id']) + assert_match(/@zammad.example.com/, ticket.articles[2].attachments[0]['filename']) + assert_equal('21', ticket.articles[2].attachments[0]['size']) + assert_equal('image/png', ticket.articles[2].attachments[0]['preferences']['Mime-Type']) + assert_equal('inline', ticket.articles[2].attachments[0]['preferences']['Content-Disposition']) + assert_match(/@zammad.example.com/, ticket.articles[2].attachments[0]['preferences']['Content-ID']) params = { ticket_id: result['ticket_id'], @@ -142,6 +148,10 @@ AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO result = JSON.parse(@response.body) assert_equal(Hash, result.class) assert_equal(1, result['attachments'].count) + assert(result['attachments'][0]['id']) + assert_equal('some_file.txt', result['attachments'][0]['filename']) + assert_equal('8', result['attachments'][0]['size']) + assert_equal('text/plain', result['attachments'][0]['preferences']['Mime-Type']) end test '02.01 ticket create with customer and articles' do diff --git a/test/unit/aaa_string_test.rb b/test/unit/aaa_string_test.rb index d538a8873..2154a2817 100644 --- a/test/unit/aaa_string_test.rb +++ b/test/unit/aaa_string_test.rb @@ -467,11 +467,41 @@ Men-----------------------' assert_equal(result, html.html2html_strict) html = "" - result = "
\n" + result = "\n
+" assert_equal(result, html.html2html_strict) html = "+
" - result = "\n" + result = "\n\n" + assert_equal(result, html.html2html_strict) + + html = "" + result = "\n" + assert_equal(result, html.html2html_strict) + + html = "+" + result = "
" + assert_equal(result, html.html2html_strict) + + html = '+' + result = '
Description
+
+' + assert_equal(result, html.html2html_strict) + + html = '
Description
+
+' + result = '
Description
+
+' + assert_equal(result, html.html2html_strict) + + html = '
Description
' + result = '
' assert_equal(result, html.html2html_strict) html = "
a\nb\nc" @@ -517,8 +547,15 @@ Men-----------------------' result = 'web.de' assert_equal(result, html.html2html_strict) - html = '
https://www.facebook.com/test
' - result = '
https://www.facebook.com/test
' + html = 'https://www.facebook.com/test' + result = '' + assert_equal(result, html.html2html_strict) + + html = '' + result = '' assert_equal(result, html.html2html_strict) html = 'some text http://example.com some other text' @@ -630,16 +667,15 @@ abc
https://www.facebook.com/testVon: Fritz Bauer [mailto:me@example.com]
Gesendet: Donnechristian.schaefer@example.com