From f7f1068bf00a0b9ace8ad5dcce19572584e2ea5e Mon Sep 17 00:00:00 2001 From: Florian Liebe Date: Mon, 20 Jun 2022 16:52:52 +0200 Subject: [PATCH] Fixes #4112 - Zammad shows "- " instead of list icon --- lib/core_ext/string.rb | 3 +++ spec/lib/core_ext/string_spec.rb | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/core_ext/string.rb b/lib/core_ext/string.rb index d35882f28..f59db8ce2 100644 --- a/lib/core_ext/string.rb +++ b/lib/core_ext/string.rb @@ -349,6 +349,9 @@ class String string.gsub!(%r{[[:space:]]*([[:space:]]*)*\Z}i, '') string.gsub!(%r{(

){1,10}\Z}i, '') + # https://github.com/zammad/zammad/issues/4112 + string.gsub!(%r{<!\[if !supportLists\]>.+?<!\[endif\]>}, '• ') + string.signature_identify('html') marker_template = '' diff --git a/spec/lib/core_ext/string_spec.rb b/spec/lib/core_ext/string_spec.rb index afc4d639e..51135ff38 100644 --- a/spec/lib/core_ext/string_spec.rb +++ b/spec/lib/core_ext/string_spec.rb @@ -1430,6 +1430,20 @@ RSpec.describe String do
  • Luxemburg
  • TEXT end + + # https://github.com/zammad/zammad/issues/4112 + it 'converts lists from MS Outlook correctly' do + expect(<<~HTML.chomp.html2html_strict).to eq(<<~TEXT.chomp) +

    + ·         + 1

    +

    + ·         + 2

    + HTML +

    • 1

    • 2

    + TEXT + end end context 'signature recognition' do