Skip to content

HtmlToMarkdownParser: Support HTML tables via inline HTML

Peter Leitzen requested to merge 372301-show-pretty-tables into master

What does this MR do and why?

This MR adds support HTML tables for Service Desk issues.

See #372301 (comment 1305661067) for more context.

Note that this functionality is still behind feature flag. See [Feature flag] Rollout `service_desk_html_to_te... (#389822 - closed).

Screenshots or screen recordings

See https://gitlab.com/gitlab-examples/ops/incident-setup/everyone/tanuki-inc/-/issues/2603#note_1305622133

GMail Before After
Screenshot_from_2023-03-08_15-24-52 Screenshot_from_2023-03-08_15-17-42 Screenshot_from_2023-03-08_15-17-50

How to set up and validate locally

  1. Download MIRO email example: miro_board.eml
  2. Create render.rb
# frozen_string_literal: true

path = "miro_board.eml"
html = Mail.new(File.read(path)).parts.first.body.to_s.force_encoding("UTF-8")
puts Gitlab::Email::HtmlToMarkdownParser.convert(html)
  1. Run bin/rails runner render.rb on master and/or this MR
  2. Paste the output into an MR/issue comment and Preview
  3. See it live in https://gitlab.com/gitlab-examples/ops/incident-setup/everyone/tanuki-inc/-/issues/2603#note_1305622133

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #372301 (closed)

Edited by Peter Leitzen

Merge request reports