diff options
Diffstat (limited to 'lib/gitlab/email/html_parser.rb')
-rw-r--r-- | lib/gitlab/email/html_parser.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab/email/html_parser.rb b/lib/gitlab/email/html_parser.rb index 27ba5d2a314..10dbedbb464 100644 --- a/lib/gitlab/email/html_parser.rb +++ b/lib/gitlab/email/html_parser.rb @@ -18,9 +18,6 @@ module Gitlab end def filter_replies! - document.xpath('//blockquote').each(&:remove) - document.xpath('//table').each(&:remove) - # bogus links with no href are sometimes added by outlook, # and can result in Html2Text adding extra square brackets # to the text, so we unwrap them here. @@ -37,7 +34,11 @@ module Gitlab end def filtered_text - @filtered_text ||= Html2Text.convert(filtered_html) + @filtered_text ||= if Feature.enabled?(:service_desk_html_to_text_email_handler) + ::Gitlab::Email::HtmlToMarkdownParser.convert(filtered_html) + else + Html2Text.convert(filtered_html) + end end end end |